How To Reinstall MySQL v5.x On Linux

To reinstall MySQL v5.x on Linux, you can follow these steps:

  1. Stop the MySQL service:
sudo systemctl stop mysqld
  1. Remove the existing MySQL installation:
sudo yum remove mysql
  1. Remove the MySQL data directory:
sudo rm -rf /var/lib/mysql
  1. Download the MySQL repository package:
wget https://repo.mysql.com/mysql57-community-release-el7-11.noarch.rpm
  1. Install the MySQL repository package:
sudo yum localinstall mysql57-community-release-el7-11.noarch.rpm
  1. Install MySQL:
sudo yum install mysql-community-server
  1. Start the MySQL service:
sudo systemctl start mysqld
  1. Configure the MySQL root password:
sudo mysql_secure_installation

These steps will reinstall MySQL v5.x on your Linux system and configure the root password for the MySQL service. Make sure to replace the version numbers and file paths with the appropriate values for your system.

Leave a Comment