命令:rpm -qa|grep -i mysql
运行结果:
MySQL-client-5.5.25a-1.rhel5 MySQL-server-5.5.25a-1.rhel5
删除命令:rpm -e –nodeps 包名
rpm -ev MySQL-client-5.5.25a-1.rhel5
rpm -ev MySQL-server-5.5.25a-1.rhel5
如果提示依赖包错误,则使用以下命令尝试:
rpm -ev MySQL-client-5.5.25a-1.rhel5 --nodeps
如果提示错误:error: %preun(xxxxxx) scriptlet failed, exit status 1
则用以下命令尝试:
rpm -e --noscripts MySQL-client-5.5.25a-1.rhel5
命令; find / -name mysql
查找结果如下:
/var/lib/mysql /var/lib/mysql/mysql /usr/lib64/mysql
删除对应的mysql目录:
rm -rf /var/lib/mysql rm -rf /var/lib/mysql rm -rf /usr/lib64/mysql
注意:卸载后/etc/my.cnf不会删除,需要进行手工删除
rm -rf /etc/my.cnf
命令:rpm -qa|grep -i mysql