Removing MySQL 5.7: A Comprehensive Guide to Purge and Uninstall
To completely remove MySQL 5.7 from an Ubuntu 12.04 system, follow these comprehensive steps:
Backup Databases
Before proceeding with the uninstallation, ensure you have backed up your essential databases using the mysqldump utility. Backup only the required databases, as a full database backup may be the root cause of the uninstalling issue.
Stop MySQL Services
Uninstall MySQL Packages
Remove User and MySQL Directory
Purge MySQL Core Packages
Remove Logs and Configuration
As a consolidated command, you can run the following single line to perform all the above steps:
sudo service mysql stop &&& sudo killall -9 mysql &&& sudo killall -9 mysqld &&& sudo apt-get remove --purge mysql-server mysql-client mysql-common &&& sudo apt-get autoremove &&& sudo apt-get autoclean &&& sudo deluser mysql &&& sudo rm -rf /var/lib/mysql &&& sudo apt-get purge mysql-server-core-5.7 &&& sudo apt-get purge mysql-client-core-5.7 &&& sudo rm -rf /var/log/mysql &&& sudo rm -rf /etc/mysql
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3