Mysql installed in yum mode
1, yum remove mysql-server mysql-libs compat-mysql51
2. rm-rf/var/lib/mysql
3. rm/etc/my. cnf
Check whether there is any mysql software:
Rpm-qa | grep mysql
If yes, continue to delete it.
Mysql installed in rpm Mode
A) check whether mysql is installed with an rpm package in the system:
[Root @ localhost opt] # rpm-qa | grep-I mysql
MySQL-server-5.6.17-1.el6.i686
MySQL-client-5.6.17-1.el6.i686
B) uninstall mysql
[Root @ localhost local] # rpm-e MySQL-server-5.6.17-1.el6.i686
[Root @ localhost local] # rpm-e MySQL-client-5.6.17-1.el6.i686
C) delete the mysql service
[Root @ localhost local] # chkconfig -- list | grep-I mysql
[Root @ localhost local] # chkconfig -- del mysql
D) delete the scattered mysql folder.
[Root @ localhost local] # whereis mysql or find/-name mysql
Mysql:/usr/lib/mysql/usr/share/mysql
Clear all related mysql directories and files
Rm-rf/usr/lib/mysql
Rm-rf/usr/share/mysql
Rm-rf/usr/my. cnf
After completing the preceding steps, mysql should have been fully uninstalled.