ubuntu卸载mysql
ubuntu如何卸载mysql(ubuntu卸载mysql的具体方法)
一、首先我们需要查看mysql依赖项,输入如下代码
dpkg --list | grep mysql
如下若所示:
ii libmysqlclient-dev 5.7.34-0ubuntu0.18.04.1 amd64 MySQL database development files
ii libmysqlclient20:amd64 5.7.34-0ubuntu0.18.04.1 amd64 MySQL database client library
ii mysql-client-5.7 5.7.34-0ubuntu0.18.04.1 amd64 MySQL database client binaries
ii mysql-client-core-5.7 5.7.34-0ubuntu0.18.04.1 amd64 MySQL database core client binaries
ii mysql-common 5.8+1.0.4 all MySQL database common files, e.g. /etc/mysql/my.cnf
ii mysql-server-5.7 5.7.34-0ubuntu0.18.04.1 amd64 MySQL database server binaries and system database setup
ii mysql-server-core-5.7 5.7.34-0ubuntu0.18.04.1 amd64 MySQL database server binaries
二、卸载mysql-common,
1.输入如下代码
代码如下(示例):
apt remove mysql-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
...
2.接下来我们就可以卸载并清除mysql5.7,输入如下代码:
代码如下:
apt autoremove --purge mysql-server-5.7
2.1 接下来我们就要来清除残留数据,输入如下代码:
dpkg -l | grep ^rc| awk '{print$2}'| sudo xargs dpkg -P
2.2 在此检查依赖项,果输出为空,那么表示mysql已经彻底卸载干净了
dpkg --list | grep mysql
2.3 如果不为空那么我们还要继续进行删除卸载,继续输入如下代码
apt autoremove --purge mysql-apt-config