Linux 卸载Mysql

1: 卸载前关闭MySQL服务

[root@localhost mysql]#systemctl stop mysql

2: 检查安装了MySQL组件,并卸载

[root@localhost mysql]# rpm -qa | grep -i mysql
mysql-community-server-5.7.23-1.el7.x86_64
mysql-community-client-5.7.23-1.el7.x86_64
mysql-community-libs-5.7.23-1.el7.x86_64
mysql-community-devel-5.7.23-1.el7.x86_64
mysql-community-common-5.7.23-1.el7.x86_64
mysql-community-libs-compat-5.7.23-1.el7.x86_64
[root@localhost init.d]# rpm -ev mysql-community-server-5.7.23-1.el7.x86_64
[root@localhost init.d]# rpm -ev mysql-community-client-5.7.23-1.el7.x86_64
[root@localhost init.d]# rpm -ev mysql-community-libs-5.7.23-1.el7.x86_64
[root@localhost init.d]# rpm -ev mysql-community-devel-5.7.23-1.el7.x86_64
[root@localhost init.d]# rpm -ev mysql-community-common-5.7.23-1.el7.x86_64
[root@localhost init.d]# rpm -ev mysql-community-libs-compat-5.7.23-1.el7.x86_64

3: 收集MySQL对应的文件夹信息并删除

[root@localhost init.d]# whereis mysql
mysql: /usr/share/mysql
[root@localhost init.d]# rm -rf /usr/share/mysql
[root@localhost init.d]# find / -name mysql
/var/lib/mysql
/var/lib/mysql/mysql

开源一个微信公众号留言小程序,欢迎大家Fork:
https://github.com/fuxingkai/LMsg

你可能感兴趣的:(Linux 卸载Mysql)