Home > Database > Mysql Tutorial > body text

How to completely uninstall MySQL from Linux system

WBOY
Release: 2023-05-29 18:46:37
forward
3110 people have browsed it

1. Use the following command to check the current installation of mysql and find out whether mysql has been installed before.

 rpm -qa|``grep` `-i mysql
Copy after login
Copy after login

You can see the following picture:

How to completely uninstall MySQL from Linux system

Show previously installed:

MySQL-client-5.5.25a-1.rhel5

MySQL-server-5.5.25a-1.rhel5

2. Stop mysql Service, delete the previously installed mysql

Delete command: rpm -e –nodeps package name

 rpm -ev MySQL-client-5.5.25a-1.rhel5``rpm -ev MySQL-server-5.5.25a-1.rhel5
Copy after login

If you are prompted with a dependency package error, use the following command to try

 rpm -ev MySQL-client-5.5.25a-1.rhel5 --nodeps
Copy after login

If Prompt error: error: %preun(xxxxxx) scriptlet failed, exit status 1

Then try the following command:

 rpm -e --noscripts MySQL-client-5.5.25a-1.rhel5
Copy after login

3. Find the directory of the previous version of mysql and delete the old version of mysql. The files and libraries

 find` `/ -name mysql
Copy after login

The search results are as follows:

 find` `/ -name mysql` `/var/lib/mysql``/var/lib/mysql/mysql``/usr/lib64/mysql
Copy after login

Delete the corresponding mysql directory

 rm` `-rf ``/var/lib/mysql``rm` `-rf ``/var/lib/mysql``rm` `-rf ``/usr/lib64/mysql
Copy after login

The specific steps are as shown in the figure: Find the directory and delete

How to completely uninstall MySQL from Linux system

Note: /etc/my.cnf will not be deleted after uninstallation and needs to be deleted manually

 rm` `-rf ``/etc/my``.cnf
Copy after login

4. Check again whether the machine has mysql installed

 rpm -qa|``grep` `-i mysql
Copy after login
Copy after login

The above is the detailed content of How to completely uninstall MySQL from Linux system. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template