一、关闭MySQL
[root@localhost /]# service mysqld stop
Redirecting to /bin/systemctl stop mysqld.service
二、查看当前安装mysql情况,查找以前是否装有mysql
[root@localhost /]# rpm -qa|grep -i mysql
mysql-community-client-8.0.13-1.el7.x86_64
mysql-community-libs-8.0.13-1.el7.x86_64
mysql-community-common-8.0.13-1.el7.x86_64
mysql-community-server-8.0.13-1.el7.x86_64
三、执行命令删除安装的MySQL
[root@localhost /]# rpm -ev mysql-community-client-8.0.13-1.el7.x86_64 --nodeps
四、查看之前安装的MySQL的目录并删除
[root@localhost /]# find / -name mysql
/var/lib/mysql
/var/lib/mysql/mysql
/usr/lib64/mysql
/usr/share/mysql
[root@localhost /]# rm -rf /var/lib/mysql
[root@localhost /]# rm -rf /var/lib/mysql/mysql
[root@localhost /]# rm -rf /usr/lib64/mysql
[root@localhost /]# rm -rf /usr/share/mysql
五、删除my.cnf
[root@localhost /]# rm -rf /etc/my.cnf
- 最后查看一下是否卸载完毕,无结果说明卸载完成。
-
[root@localhost /]# rpm -qa|grep -i mysql
文章来源地址https://www.toymoban.com/news/detail-841992.html
文章来源:https://www.toymoban.com/news/detail-841992.html
到了这里,关于详解Linux环境下卸载MySQL的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!