Completely uninstall mysql:
Uninstall the mysql installation package
yum remove mysql mysql-server mysql-libs compat-mysql51 yum remove mysql-community-release rpm -e --nodeps mysql-community-libs-5.7.22-1.el7.x86_64 rpm -e –nodeps mysql57-community-release-el7-11.noarch
Delete the remaining mysql directories or files:
Query the mysql installation Directory
whereis mysql
find / -name mysql
Delete the queried directory:
rm -rf /usr/lib64/mysql rm -rf /usr/share/mysql rm -rf /usr/bin/mysql rm -rf /etc/logrotate.d/mysql rm -rf /var/lib/mysql rm -rf /var/lib/mysql/mysql
Delete mysql configuration file
rm –rf /usr/my.cnf rm -rf /root/.mysql_sercret
Recommended tutorial:centos usage tutorial
The above is the detailed content of How to delete mysql in centos. For more information, please follow other related articles on the PHP Chinese website!