要專業(yè)地卸載MySQL,請遵循以下步驟:
mysqldump
命令來完成這個(gè)操作。mysqldump -u [username] -p[password] --all-databases > backup.sql
sudo service mysql stop
sudo systemctl stop mysqld
sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo yum remove mysql-server mysql-client mysql-common
/etc/mysql/
/var/lib/mysql/
/var/log/mysql/
你可以使用rm
命令來刪除這些文件和目錄:
sudo rm -rf /etc/mysql/
sudo rm -rf /var/lib/mysql/
sudo rm -rf /var/log/mysql/
find
命令來查找這些文件:sudo find / -iname "*mysql*" -type f -delete
sudo find / -iname "*mysql*" -type d -delete
sudo apt-get update
sudo yum update
現(xiàn)在你已經(jīng)成功地專業(yè)地卸載了MySQL。如果需要,你可以隨時(shí)按照上述步驟重新安裝MySQL。