Home  >  Article  >  Database  >  Centos-mysql uninstall

Centos-mysql uninstall

远方*
远方*Original
2022-03-10 13:31:59160browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn