MySQL卸载
1:卸载前关闭MySQL服务
1.1查看mysql的服务运行状态
[root@DB-Server ~]#service mysqld status
1.2停止mysql的服务
[root@DB-Server ~]#service mysqld stop
1.3检查是否安装了MySQL组件,确认MySQL是否卸载删除
查询是否有mysql的安装:
[root@DB-Server ~]# rpm -qa |grep -i mysql
1.4查询是否有Mariadb的安装:
[root@DB-Server ~]# rpm -qa|grep -i mariadb
如果有卸载掉:
[root@DB-Server ~]# yum -y remove 文件名 ## [root@DB-Server ~]# rpm -evh --nodeps mariadb-libs-5.5.60-1.el7-5.x86_64
[root@DB-Server ~]#yum -y remove mysql-community-client-5.7.38-1.el7.x86_64
[root@DB-Server ~]#yum -y remove mysql-community-libs-5.7.38-1.el7.x86_64
[root@DB-Server ~]#yum -y remove mysql-community-common-5.7.38-1.el7.x86_64
[root@DB-Server ~]#yum -y remove mysql-community-server-5.7.38-1.el7.x86_64
1.5 查找文件目录
[root@DB-Server ~]#find / -name mysql ## [root@DB-Server ~]#whereis mysql
1.6 删除mysql文件目录
[root@DB-Server ~]#rm -rf /data/mysql
[root@DB-Server ~]#rm -rf /usr/share/mysql
[root@DB-Server ~]#rm -rf /home/mysql
[root@DB-Server ~]#rm -rf /var/spool/mail/mysql
[root@DB-Server ~]#rm -rf /var/lib/mysql
[root@DB-Server ~]#rm -rf /usr/lib64/mysql
[root@DB-Server ~]#rm -rf /etc/selinux/targeted/active/modules/