Completely uninstall MySQL under Linux detailed

Source: Internet
Author: User

Completely uninstall MySQL under Linux detailed

First, use the following command to view the current installation of MySQL, to find out if previously installed MySQL

1 rpm -qa|grep-i mysql

You can see the following as shown:

The display was previously installed:

Mysql-client-5.5.25a-1.rhel5

Mysql-server-5.5.25a-1.rhel5

2. Stop the MySQL service, delete the previously installed MySQL

Delete command:rpm -e –nodeps 包名

12 rpm -ev MySQL-client-5.5.25a-1.rhel5  rpm -ev MySQL-server-5.5.25a-1.rhel5

If the prompt depends on the package error, use the following command to try

1 rpm -ev MySQL-client-5.5.25a-1.rhel5 --nodeps

If you are prompted with an error:error: %preun(xxxxxx) scriptlet failed, exit status 1

Then try it with the following command:

1 rpm -e --noscripts MySQL-client-5.5.25a-1.rhel5

3, find the old version of MySQL directory, and delete the old version of MySQL files and libraries

1 find/ -name mysql

The search results are as follows:

12345 find/ -name mysql   /var/lib/mysql/var/lib/mysql/mysql/usr/lib64/mysql

Delete the corresponding MySQL directory

123 rm-rf /var/lib/mysqlrm -rf /var/lib/mysqlrm-rf /usr/lib64/mysql

Specific steps to find the directory and delete

Note: /etc/my.cnf will not be removed after uninstallation, manual removal is required

1 rm-rf /etc/my.cnf

4. Find out if the machine installs MySQL again

1 rpm -qa|grep-i mysql

Completely uninstall MySQL under Linux detailed

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.