Centos7 卸载 mysql5.7

Centos7 卸载 mysql5.7

1查看是否安装了MySQL
[root@linux01 ~]# rpm -qa | grep mysql
mysql57-community-release-el7-8.noarch
mysql-community-client-5.7.27-1.el7.x86_64
mysql-community-libs-5.7.27-1.el7.x86_64
mysql-community-libs-compat-5.7.27-1.el7.x86_64
mysql-community-common-5.7.27-1.el7.x86_64
mysql-community-server-5.7.27-1.el7.x86_64
2关闭MySQL服务
查看mysql状态
systemctl status mysqld
关闭服务
 systemctl stop mysqld
3 卸载MySQL组件
[root@linux01 ~]# rpm -e mysql57-community-release-el7-8.noarch
[root@linux01 ~]# rpm -e mysql-community-client-5.7.27-1.el7.x86_64 --nodeps
[root@linux01 ~]# rpm -e mysql-community-libs-5.7.27-1.el7.x86_64 --nodeps
[root@linux01 ~]# rpm -e mysql-community-libs-compat-5.7.27-1.el7.x86_64 --nodeps
[root@linux01 ~]# rpm -e mysql-community-common-5.7.27-1.el7.x86_64 --nodeps
[root@linux01 ~]# rpm -e mysql-community-server-5.7.27-1.el7.x86_64 --nodeps
4 查找mysql文件
[root@linux01 ~]# find / -name mysql
[root@linux01 ~]# whereis mysql
/usr/share/mysql
/usr/lib64/mysql
/var/lib/mysql
/var/lib/mysql/mysql
/etc/selinux/targeted/active/modules/100/mysql
5 删除mysql文件
[root@linux01 ~]# rm -rf /usr/share/mysql
[root@linux01 ~]# rm -rf /usr/lib64/mysql
[root@linux01 ~]# rm -rf /var/lib/mysql
[root@linux01 ~]# rm -rf /var/lib/mysql/mysql
[root@linux01 ~]# rm -rf /etc/selinux/targeted/active/modules/100/mysql

你可能感兴趣的:(数据库,MySQL,卸载,CentOS)