The first way to uninstall: yum uninstall
Check if yum has installed mysql
yum list installed mysql*
yum command to uninstall
yum remove MySQL-client MySQL-devel MySQL-embedded MySQL-server MySQL-shared MySQL-shared-compat MySQL-test rm -rf /var/lib/mysql rm /etc/my.cnf
The second way to uninstall: rpm uninstall
rpmView installation
rpm -qa | grep -i mysql
rpm Uninstall
rpm -e mysql57-community-release-el7-9.noarch rpm -e mysql-community-server-5.7.17-1.el7.x86_64 rpm -e mysql-community-libs-5.7.17-1.el7.x86_64 rpm -e mysql-community-libs-compat-5.7.17-1.el7.x86_64 rpm -e mysql-community-common-5.7.17-1.el7.x86_64 rpm -e mysql-community-client-5.7.17-1.el7.x86_64 cd /var/lib/ rm -rf mysql/
Clear remaining items
whereis mysql mysql: /usr/bin/mysql /usr/lib64/mysql /usr/local/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz
Delete the above folder
rm -rf /usr/bin/mysql
Delete configuration
rm –rf /usr/my.cnf rm -rf /root/.mysql_sercret
Remaining configuration check
chkconfig --list | grep -i mysqlchkconfig --del mysqld
The above is the detailed content of Centos-mysql uninstall. For more information, please follow other related articles on the PHP Chinese website!