Mysql包mysql-server-5.6卸载错误

Mysql包mysql-server-5.6卸载错误

当我尝试卸载 mysql 时,出现以下错误

$ apt-get remove --purge mysql*.*
 Reading package lists... Done
 Building dependency tree
        Reading state information... Done
 E: The package mysql-server-5.6 needs to be reinstalled, but I can't find an archive for it

如何重新安装或卸载 mysql-server-5.6

谢谢

答案1

彻底删除 MySql:

1.停止MySql数据库服务器

sudo service mysql stop

或者

sudo service mysqld stop

2.杀死所有MySql相关进程

sudo killall -9 mysql
sudo killall -9 mysqld

3.删除MySql文件和相关依赖项

sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean

4.删除数据库用户

sudo deluser mysql

5.最后,删除所有MySql相关目录

sudo rm -rf /var/log/mysql*
sudo rm -rf /var/lib/mysql*
sudo rm -rf /etc/mysql*

相关内容