Get the App
SLTechnology News&Howtos  ›  Servers  › 

Several methods of complete unloading of MySQL under CentOS

Shulou Source: shulou.com Published: 2022-06-02 04:53:41 11月25日 Update

This article introduces several methods to completely uninstall MySQL under CentOS and shares them with you. The details are as follows:

1: check whether MySQL is installed:

Method 1:

[root@localhost usr] # yum list installed mysql*Loaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: mirrors.yun-idc.com * extras: mirror.neu.edu.cn * updates: mirrors.yun-idc.comInstalled PackagesMySQL-client.x86_64 5.6.27-1.el6 installedMySQL-devel.x86_64 5.6.27-1.el6 installedMySQL-server.x86_64 5.6.27-1.el6 installed [root@localhost usr] #

Method 2 (- I: case-insensitive):

[root@localhost usr] # rpm-qa | grep-I mysqlMySQL-server-5.6.27-1.el6.x86_64MySQL-client-5.6.27-1.el6.x86_64MySQL-devel-5.6.27-1.el6.x86_64 [root@localhost usr] #

2: uninstall MySQL:

Uninstall 1:

[root@localhost usr] # yum remove mysql mysql-server mysql-libs compat-mysql51 [root@localhost usr] # rm-rf / var/lib/mysql [root@localhost usr] # rm / etc/my.cnf

If mysql-devel (other add command) is installed, uninstall it as follows:

The copy code is as follows:

[root@Tony_ts_tian init.d] # yum remove mysql mysql-devel mysql-server mysql-libs compat-mysql51

Note (for example):

Mysql-5.5.39-1.el6.remi.x86_64

Mysql-libs-5.5.39-1.el6.remi.x86_64

Compat-mysql51-5.1.54-1.el6.remi.x86_64

Mysql-server-5.5.39-1.el6.remi.x86_64

Uninstall 2 {continue, 1Pol 2 choose one (here for introduction):}:

[root@localhost mysql] # rpm-aq | grep-I mysqlMySQL-server-5.6.27-1.el6.x86_64MySQL-client-5.6.27-1.el6.x86_64MySQL-devel-5.6.27-1.el6.x86_64 [root@localhost mysql] # rpm-e MySQL-server-5.6.27-1.el6.x86_64 [root@localhost mysql] # rpm-e MySQL-client-5.6.27-1.el6.x86_64 [root@ Localhost mysql] # rpm-e MySQL-devel-5.6.27-1.el6.x86_64 [root@localhost rc.d] # cd / var/lib/ [root@localhost lib] # rm-rf mysql/

Note: delete the MySQL database directory (key), otherwise password will not update (default installation, if custom installation path and link path ln-s... Please delete it. )

Rm-rf / var/lib/mysql

Uninstall 3:

[root@localhost usr] # whereis mysqlmysql: / usr/lib64/mysql [root@localhost usr] # rm-rf / usr/lib64/mysql

Note: find /-name mysql

Note: clear all directories, files and other configurations and settings related to mysql. If so, delete it. It must also be considered that other software will not affect it.

Rm-rf / usr/lib/mysql

Rm-rf / usr/share/mysql

Uninstall 4:

[root@localhost usr] # rm-rf / usr/my.cnf [root@localhost usr] # rm-rf / root/.mysql_sercret

Uninstall 5 (self-starting service):

[root@localhost usr] # chkconfig-- list | grep-I mysql [root@localhost usr] # chkconfig-- del mysqld

Delete here and see your own settings: mysql/mysqld

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

Tags: Code method directory path method key content size that is data database file software link customization learning help influence support update Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Linux Shulou Technology MySQL Microsoft