CentOS7.7 彻底卸载MySQL5.7

Posted 汤向峰

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CentOS7.7 彻底卸载MySQL5.7相关的知识,希望对你有一定的参考价值。

1.关闭mysql服务

[root@VM_0_8_centos ~]# systemctl stop mysqld

2.使用 rpm 命令查看已安装的安装包

[root@VM_0_8_centos ~]# rpm -qa|grep mysql
mysql-community-libs-5.7.29-1.el7.x86_64
mysql-community-common-5.7.29-1.el7.x86_64
mysql-community-client-5.7.29-1.el7.x86_64
mysql-community-server-5.7.29-1.el7.x86_64
mysql57-community-release-el7-11.noarch

3.使用yum卸载安装的mysql

[root@VM_0_8_centos ~]# yum remove  mysql mysql-server mysql-libs mysql-server

4.查询剩余的安装包

[root@VM_0_8_centos ~]# rpm -qa|grep mysql
mysql-community-common-5.7.29-1.el7.x86_64
mysql57-community-release-el7-11.noarch

5.移除掉这些安装包

[root@VM_0_8_centos ~]# rpm -ev mysql-community-common-5.7.29-1.el7.x86_64
软件包准备中...
mysql-community-common-5.7.29-1.el7.x86_64
[root@VM_0_8_centos ~]# rpm -ev mysql57-community-release-el7-11.noarch
软件包准备中...
mysql57-community-release-el7-11.noarch

6.检查残余安装包

[root@VM_0_8_centos ~]# ls
mysql57-community-release-el7-11.noarch.rpm Python-3.7.1.tar.xz.1 wget-log
mysql80-community-release-el7-3.noarch.rpm usr
mysql80-community-release-el7-3.noarch.rpm.1 vim

7.删除残余的安装包

[root@VM_0_8_centos ~]# rm -rf mysql*

8.继续查找是否还有残留文件

[root@VM_0_8_centos ~]# find / -name mysql
/var/lib/mysql
/var/lib/mysql/mysql
/usr/share/mysql

9.移除这些残留文件

[root@VM_0_8_centos ~]# rm -rf /var/lib/mysql
[root@VM_0_8_centos ~]# rm -rf /var/lib/mysql/mysql
[root@VM_0_8_centos ~]# rm -rf /usr/share/mysql

10.最后的检查

[root@VM_0_8_centos ~]# rpm -qa|grep mysql
[root@VM_0_8_centos ~]# find / -name mysql
[root@VM_0_8_centos ~]# ls
Python-3.7.1.tar.xz.1 usr vim wget-log

如果有的话继续执行删除就行 直到删干净为止

如果没有的话,那么恭喜你,已经删除完成了!!!

以上是关于CentOS7.7 彻底卸载MySQL5.7的主要内容,如果未能解决你的问题,请参考以下文章

CentOS7.7下二进制部署MySQL多版本多实例实战

CentOS7.7中安装MySQL5.7教程(超详细)

centos7.7中安装mysql5.7出现and PID file is not owned by root. Refusing错误

MySQL5.7彻底取消主从复制

win10环境下mysql5.7压缩包解压安装过程

Mac Mysql5.7.11安装和卸载