从 Ubuntu 16.04 卸载 Mysql 5.7

从 Ubuntu 16.04 卸载 Mysql 5.7

我在 ubuntu 16.04 中使用 mysql 5.7 时遇到了授予用户权限的问题,所以我想重新安装它,但是当我输入删除 mysql 的命令时,我收到以下消息

nato@nato-Compaq-Presario-CQ61-Notebook-PC:~$ sudo apt-get remove --purge mysql-server mysql-client mysql-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
 dbconfig-mysql : Depends: mysql-client but it is not going to be installed or
                  mariadb-client but it is not going to be installed or
                  virtual-mysql-client

E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

我也尝试过以下命令,但结果相同

sudo apt-get remove --purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean

答案1

答案就在错误本身中。

dbconfig-mysql : Depends: mysql-client but it is not going to be installed or mariadb-client but it is not going to be installed or virtual-mysql-client

第一步是删除不允许删除 MySQL 包的依赖项。

sudo apt-get remove dbconfig-mysql
sudo apt-get remove --purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean

答案2

卸载

sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.5 mysql-client-core-5.5

删除目录

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

清理

sudo apt-get autoremove
sudo apt-get autoclean

答案3

它对我有用

sudo apt-get purge mysql*
sudo apt-get autoremove

也可以尝试看看https://askubuntu.com/questions/776845

相关内容