CentOS7.7 彻底卸载MySQL5.7

【CentOS7.7 彻底卸载MySQL5.7】业无高卑志当坚,男儿有求安得闲?这篇文章主要讲述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 removemysql 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.rpmpython-3.7.1.tar.xz.1wget-log
mysql80-community-release-el7-3.noarch.rpmusr
mysql80-community-release-el7-3.noarch.rpm.1vim

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.1usrvimwget-log

如果有的话继续执行删除就行 直到删干净为止
如果没有的话,那么恭喜你,已经删除完成了!!!

    推荐阅读