Uninstall the Linux version mysql8.x

First, stop the MySQL

[root@localhost /]# service mysqld stop

Second, install mysql view the current situation, to find out whether previously fitted with mysql

[root@localhost /]# rpm -qa|grep -i mysql
mysql-community-client-8.0.13-1.el7.x86_64
mysql-community-libs-8.0.13-1.el7.x86_64
mysql-community-common-8.0.13-1.el7.x86_64
mysql-community-server-8.0.13-1.el7.x86_64

Third, execute the command to delete the installation of MySQL

[root@localhost /]# rpm -ev mysql-community-client-8.0.13-1.el7.x86_64


Error:

error: Failed dependencies:
    mysql-community-client(x86-64) >= 8.0.0 is needed by (installed) mysql-community-server-8.0.13-1.el7.x86_64

 

The reason is wrong dependencies, then execute the following command to solve:

[root@localhost /]# rpm -ev mysql-community-client-8.0.13-1.el7.x86_64 --nodeps

The remaining number of operations performed according to the aforesaid, together --nodeps

Then execute # rpm -qa | grep -i mysql command to check whether deleted successfully.

 

Four: MySQL installed before viewing the directory and delete

[root@localhost /]# find / -name mysql
/var/lib/mysql
/var/lib/mysql/mysql
/usr/lib64/mysql
/usr/share/mysql
[root@localhost /]# rm -rf /var/lib/mysql
[root@localhost /]# rm -rf /var/lib/mysql/mysql
[root@localhost /]# rm -rf /usr/lib64/mysql
[root@localhost /]# rm -rf /usr/share/mysql


Five: Delete my.cnf

After uninstalling /etc/my.cnf does not remove the need to manually delete

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

Finally, check to see if the uninstallation is completed, no results indicate that uninstall is complete.

[root@localhost /]# rpm -qa|grep -i mysql

 


Original: https: //blog.csdn.net/eric_wii/article/details/86300450

Guess you like

Origin www.cnblogs.com/Mr-Rshare/p/11819161.html
Recommended