1. 刪除mysql
sudo apt-get autoremove --purge mysql-server-5.0mysql
sudo apt-get remove mysql-serversql
sudo apt-get autoremove mysql-serverspa
sudo apt-get remove mysql-common code
2. 清理殘留數據
dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P
3. 安裝 mysql
sudo apt-get install mysql-server
sudo apt-get install mysql-client
4 解決普通用戶沒法登陸的問題:
sudo mysql -u root -p
select user, plugin from mysql.user;
update mysql.user set authentication_string=PASSWORD('newPwd'), plugin='mysql_native_password' where user='root';
flush privileges;
exit
從新進入