1. Find out if MySQL was previously installed
Command: Rpm-qa|grep-i MySQL
You can see the following as shown:
Description was previously installed:
Mysql-client-5.5.25a-1.rhel5
Mysql-server-5.5.25a-1.rhel5
2. Stop the MySQL service, delete the previously installed MySQL
Delete command: Rpm-e–nodeps package name
# Rpm-ev Mysql-client-5.5.25a-1.rhel5
# Rpm-ev Mysql-server-5.5.25a-1.rhel5
3, find the old version of MySQL directory, and delete the old version of MySQL files and libraries
Find/-name MySQL
The search results are as follows:
[Root@localhost ~]# Find/-name MySQL
/var/lib/mysql
/var/lib/mysql/mysql
/usr/lib64/mysql
Delete the corresponding MySQL directory
Rm-rf/var/lib/mysql
Rm-rf/var/lib/mysql
Rm-rf/usr/lib64/mysql
Specific steps to find the directory and delete
Note:/ETC/MY.CNF will not be removed after uninstallation, manual removal is required
Rm-rf/etc/my.cnf
4. Find out if the machine installs MySQL again
Rpm-qa|grep-i MySQL
No results, instructions have been uninstalled thoroughly, next install MySQL directly
How to completely remove MySQL under Linux