1. 删除mysql
sudo apt-get autoremove --purge mysql-server-5.0
sudo apt-get remove mysql-server
sudo apt-get autoremove mysql-server
sudo apt-get remove mysql-common
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
重新进入