问题背景:
mysql卸载或者删除不干净,导致再次安装或者影响其他服务。
执行以下操作让你彻底卸载Mysql
第一步删除系统自带的
执行如下命令
[root@192 ~]# rpm -qa | grep mariadbmariadb-libs-5.5.68-1.el7.x86_64[root@192 ~]# rpm -e --nodeps mariadb-libs
第二步删除之前安装的mysql
执行如下命令
[root@192 ~]# rpm -qa|grep -i mysqlmysql-community-client-5.7.28-1.el7.x86_64mysql-community-common-5.7.28-1.el7.x86_64mysql-community-libs-5.7.28-1.el7.x86_64mysql-community-libs-compat-5.7.28-1.el7.x86_64mysql-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彻底清除!
来源地址:https://blog.csdn.net/wangning0714/article/details/129888029