How to completely delete mysql from Centos
1. MySQL installed in yum Mode
$ Yum remove mysql-server mysql-libs compat-mysql51
$ Rm-rf/var/lib/mysq
$ Rm/etc/my. cnf
Check whether there is any mysql software:
$ Rpm-qa | grep mysql
If yes, continue to delete it. The deletion method is yum remove + [name ].
2. 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 steps above, mysql should have been completely uninstalled.