Linux下彻底卸载MySQL

x33g5p2x  于2021-10-09 转载在 Linux  
字(0.7k)|赞(0)|评价(0)|浏览(434)

一、查看MySQL的安装情况

rpm -qa|grep -i mysql

二、删除命令:rpm -e –nodeps 包名

mysql80-community-release-el7-3.noarch
mysql-community-common-8.0.26-1.el7.x86_64
mysql-community-client-8.0.26-1.el7.x86_64
mysql-community-libs-8.0.26-1.el7.x86_64
mysql-community-libs-compat-8.0.26-1.el7.x86_64
mysql-community-server-8.0.26-1.el7.x86_64
mysql-community-client-plugins-8.0.26-1.el7.x86_64

rpm -ev mysql-community-client-8.0.26-1.el7.x86_64 --nodeps
rpm -ev mysql-community-server-8.0.26-1.el7.x86_64 --nodeps
rpm -ev mysql-community-client-plugins-8.0.26-1.el7.x86_64 --nodeps

三、查找之前老版本mysql的目录、并且删除老版本mysql的文件和库

find / -name mysql

rm -rf /usr/lib/mysql
rm -rf  /usr/lib64/mysql
rm -rf  /usr/include/mysql

rm -rf /etc/my.cnf

检查是够卸载完成:

rpm -qa|grep -i mysql

没有任何结果的话,就说明卸载完成!

相关文章