Completely Uninstall MySQL 5.7 on CentOS 7 [Test Successful]

Method 1:

1. Check MySQL installation

rpm -qa|grep -i mysql

Completely Uninstall MySQL 5.7 on CentOS 7 [Test Successful]

2. Stop MySQL service before uninstalling

rpm -ev --nodeps mysql-community-release-el7-5.noarch
rpm -ev --nodeps mysql-community-common-5.6.38-2.el7.x86_64
rpm -ev --nodeps mysql-community-client-5.6.38-2.el7.x86_64
rpm -ev --nodeps mysql-community-libs-5.6.38-2.el7.x86_64
rpm -ev --nodeps community-server-5.6.38-2.el7.x86_64

After executing the command, execute again rpm -qa|grep -i mysql to find that it has been uninstalled.

Or directly # yum -y remove mysql

Method 2:

Execute the command

find / -name mysql

Completely Uninstall MySQL 5.7 on CentOS 7 [Test Successful]

Delete the directories found

rm -rf the directories found above

Completely Uninstall MySQL 5.7 on CentOS 7 [Test Successful]

If /etc/my.cnf exists, delete it manually, and MySQL will be completely uninstalled.

[root@node1 ~]# rm -rf /etc/my.cnf

[root@node1 ~]# rm -rf /var/lib/mysql/

Completely Uninstall MySQL 5.7 on CentOS 7 [Test Successful]

Copyright Statement: This content is from Tencent Cloud: OwenZhang, following the CC 4.0 BY-SA copyright agreement. The original text and this statement are included. This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 2.5 China Mainland License. Original link: https://cloud.tencent.com/developer/article/1915345 If there is any infringement, please contact us, and we will delete it immediately. Special thanks to the original author for their creation. All copyrights of this article belong to the original author and are unrelated to this public account. For commercial reprints, please contact the original author; for non-commercial reprints, please indicate the source.

Leave a Comment