How to uninstall MySQL 8.0 version under Linux

How to uninstall MySQL 8.0 version under Linux

1. Shut down MySQL

[root@localhost /]# service mysqld stop
Redirecting to /bin/systemctl stop mysqld.service

2. Check the current installation of MySQL and find out whether MySQL was installed before

[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

3. Execute the command to delete the installed 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 that the dependency package is wrong. Execute the following command to solve it:

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

The remaining ones are also executed according to the above operations, plus --nodeps

Then execute the # rpm -qa|grep -i mysql command to check whether the deletion is successful.

Four: Check the directory of the previously installed MySQL and delete it

[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 uninstallation, /etc/my.cnf will not be deleted and needs to be deleted manually.

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

Finally, check whether the uninstallation is complete. If there is no result, it means the uninstallation is complete.

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

The above is the relevant knowledge about uninstalling MySQL 8.0 on Linux. Thank you for your learning and support for 123WORDPRESS.COM.

<<:  MySQL 8.0.15 winx64 installation and configuration method graphic tutorial under windows

>>:  The difference between hash mode and history mode in vue-router

Recommend

React diff algorithm source code analysis

Table of contents Single Node Diff reconcileSingl...

Tutorial analysis of quick installation of mysql5.7 based on centos7

one. wget https://dev.mysql.com/get/mysql57-commu...

A brief introduction to MySQL dialect

Putting aside databases, what is dialect in life?...

Detailed explanation of the basic usage of the img image tag in HTML/XHTML

The image tag is used to display an image in a we...

Solve the problem that Docker pulls MySQL image too slowly

After half an hour of trying to pull the MySQL im...

Installation tutorial of the latest stable version of MySQL 5.7.17 under Linux

Install the latest stable version of MySQL on Lin...

Sample code for partitioning and formatting a disk larger than 20TB on centos6

1. Server environment configuration: 1. Check dis...

Sample code for generating QR code using js

Some time ago, the project needed to develop the ...

Detailed explanation of the new CSS display:box property

1. display:box; Setting this property on an eleme...

How to determine if the Linux system is installed on VMware

How to determine whether the current Linux system...

How to use Dayjs to calculate common dates in Vue

When using vue to develop projects, the front end...

Summary of the differences between Mysql primary key and unique key

What is a primary key? A primary key is a column ...

JavaScript to achieve a simple magnifying glass effect

There is a picture in a big box. When you put the...