#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