To reinstall MySQL version 5.x on a Linux system, you can follow these steps:
$ sudo apt-get remove mysql-server mysql-client mysql-commonSour:ecwww.lautturi.com
This will remove the MySQL server, client, and common packages from the system.
$ sudo rm -rf /etc/mysql /var/lib/mysql
This will delete the MySQL configuration files and directories from the system.
$ wget http://repo.mysql.com/mysql-apt-config_0.8.15-1_all.deb $ sudo dpkg -i mysql-apt-config_0.8.15-1_all.deb
This will download and install the MySQL repository package, which will allow you to install MySQL from the official MySQL repositories.
$ sudo apt-get update
This will update the list of available packages from the repositories.
$ sudo apt-get install mysql-server-5.6
This will install the MySQL server package for version 5.6. Replace 5.6
with the version of MySQL that you want to install (e.g., 5.7
, 8.0
).
$ sudo mysql_secure_installation
This will run the MySQL security configuration script, which will prompt you to set the root password, remove anonymous users, and disable remote root login.
$ sudo systemctl start mysql
This will start the MySQL server service.
Keep in mind that the specific steps and commands for installing and configuring MySQL on a Linux system may vary depending on your Linux distribution and version. Consult the MySQL documentation or the man pages for your system for more information.