Linux rpm way to completely uninstall mysql

The version of MySQL installed by rehdhat is relatively low. Before upgrading, you need to delete the original MySQL. The process of completely uninstalling MySQL in linux rpm is as follows:

1. Find the installed mysql:

[root@host ~]# rpm -qa | grep mysql

mysql-server-5.0.95-1.el5_7.1
mysql-5.0.95-1.el5_7.1
mysql-5.0.95-1.el5_7.1

2. Delete them directly:

[root@host ~]# rpm -e --nodeps mysql mysql-server
[root@host ~]# rpm -e --allmatches mysql-5.0.95-1.el5_7.1

3. Find out whether the mysql service exists and close it.

[root@host ~]# chkconfig --del mysql

[root@host ~]# chkconfig --list | grep -i mysql  

4. Delete the mysql folder and delete the mysql configuration file:

[root@host ~]# rm -rf /user/local/mysql

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

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326769777&siteId=291194637