mysql卸载或者删除不干净,导致再次安装或者影响其他服务。
执行以下操作让你彻底卸载Mysql
执行如下命令
[root@192 ~]# rpm -qa | grep mariadb mariadb-libs-5.5.68-1.el7.x86_64 [root@192 ~]# rpm -e --nodeps mariadb-libs
执行如下命令
[root@192 ~]# rpm -qa|grep -i mysql mysql-community-client-5.7.28-1.el7.x86_64 mysql-community-common-5.7.28-1.el7.x86_64 mysql-community-libs-5.7.28-1.el7.x86_64 mysql-community-libs-compat-5.7.28-1.el7.x86_64 mysql-community-server-5.7.28-1.el7.x86_64 [root@192 ~]# yum remove mysql-community-client-5.7.28-1.el7.x86_64
依次卸载已经存在mysql服务
yum remove mysql-community-client-5.7.28-1.el7.x86_64
yum remove mysql-community-common-5.7.28-1.el7.x86_64
yum remove mysql-community-libs-5.7.28-1.el7.x86_64
yum remove mysql-community-libs-compat-5.7.28-1.el7.x86_64
yum remove mysql-community-server-5.7.28-1.el7.x86_64
执行如下命令:查看文件名中含有MySQL的文件并且依次删除
[root@192 ~]# find / -name mysql /etc/selinux/targeted/active/modules/100/mysql /usr/share/mysql [root@192 ~]# rm -rf /etc/selinux/targeted/active/modules/100/mysql [root@192 ~]# rm -rf /usr/share/mysql [root@192 ~]#
删除其他有关MySQL服务
//mysql的配置文件
rm -rf /etc/my.cnf
//如果不删除这个文件,则重新安装的Mysql将无法设置password
rm -rf /var/log/mysqld.log
-------------------------------------
至此,mysql彻底清除!