linux卸载MySQL 一 查找以前是否装有mysql rpm -qa|grep -i mysql 显示之前安装了: MySQL-server-5.6.22-1.el6.i686 MySQL-client-5.6.22-1.el6.i686
二 停止mysql服务、删除之前安装的mysql 删除命令:rpm -e –nodeps 包名
rpm -ev MySQL-server-5.6.22-1.el6.i686 rpm -ev MySQL-client-5.6.22-1.el6.i686
如果提示依赖包错误,则使用以下命令尝试 rpm -ev MySQL-client-5.6.22-1.el6.i686 --nodeps
如果提示错误: error: %preun(xxxxxx) scriptlet failed, exit status 1 则用以下命令尝试: rpm -e --noscripts MySQL-client-5.6.22-1.el6.i686
三 查找之前老版本mysql的目录、并且删除老版本mysql的文件和库 find / -name mysql
查找结果如下: find / -name mysql
/var/lib/mysql /var/lib/mysql/mysql /run/lock/subsys/mysql /etc/selinux/targeted/active/modules/100/mysql /usr/lib64/mysql /usr/share/mysql /usr/lib/mysql /usr/local/mysql
删除对应的mysql目录 rm -rf /usr/lib/mysql rm -rf /usr/local/mysql rm -rf /usr/lib64/mysql rm -rf /run/lock/subsys/mysql rm -rf /etc/selinux/targeted/active/modules/100/mysql …
四 卸载后/etc/my.cnf不会删除,需要手工删除 rm -rf /etc/my.cnf
五 再次查找机器是否安装mysql rpm -qa|grep -i mysql
标签:22,mysql,linux,i686,usr,卸载,MySQL,rpm From: https://blog.51cto.com/u_16149347/6407525