卸载mysql
sudo -i
service mysql stop
killall -KILL mysql mysqld_safe mysqld
apt-get --yes purge mysql-server mysql-client
apt-get --yes autoremove --purge
apt-get autoclean
deluser --remove-home mysql
delgroup mysql
rm -rf /etc/apparmor.d/abstractions/mysql /etc/apparmor.d/cache/usr.sbin.mysqld /etc/mysql /var/lib/mysql /var/log/mysql* /var/log/upstart/mysql.log* /var/run/mysqld
updatedb
exit
删除log文件
rm ~/.mysql_history
awk -F : '{ print($6 "/.mysql_history"); }' /etc/passwd | xargs -r -d '\n' -- sudo rm -f --
sudo find / -name .mysql_history -delete
- 问题解决:find: ‘/run/user/1000/gvfs’: Permission denied解决办法
umount /run/user/1000/gvfs
rm -rf /run/user/1000/gvfs
安装
- 检查MySQL是否卸载干净
dpkg --list|grep mysql
- 默认安装
sudo apt-get install mysql-client mysql-server
- 安装完成后查看MySQL状态
sudo service mysql status
- 登陆MySQL
mysql -u root -p
网友评论