win10内置ubuntu,mysql完美清理,并安装

时间:2022-02-22 18:20:07
#mysql完美清理

1.
sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-* mysql-client-core-*
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean
2.
sudo service mysql stop  #or mysqld
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 -f 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
3.
sudo rm /var/lib/mysql/ -R 
sudo rm /etc/mysql/ -R 
sudo apt-get autoremove mysql* --purge 
sudo apt-get remove apparmor 
sudo apt-get install mysql-server mysql-common