Linux卸载mysql

1、检查已安装的MySQL组件
rpm -qa | grep -i mysql

2、停止mysql服务
service mysqld stop

3、删除MySQL组件
rpm -eh mysql-community-common-5.7.24-1.el7.x86_64.rpm
rpm -eh mysql-community-libs-5.7.24-1.el7.x86_64.rpm
rpm -eh mysql-community-client-5.7.24-1.el7.x86_64.rpm
rpm -eh mysql-community-server-5.7.24-1.el7.x86_64.rpm

4、查找并删除MySQL相关的文件夹
find / -name mysql
rm -rf /var/lib/mysql
rm -rf /var/lib/mysql/mysql
rm -rf /var/log/mysqld.log
rm -rf /etc/my.cnf

5、查找并删除mysql用户及用户组
more /etc/passwd | grep mysql
more /etc/shadow | grep mysql

6、使用步骤1检查是否还有残留

posted on 2019-01-10 14:18  wanbao  阅读(979)  评论(0编辑  收藏  举报