How to completely remove MySQL under Linux

Source: Internet
Author: User

1. Find out if MySQL was previously installed

Command: Rpm-qa|grep-i MySQL
You can see the following as shown:

Description 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 package name
# Rpm-ev Mysql-client-5.5.25a-1.rhel5
# Rpm-ev Mysql-server-5.5.25a-1.rhel5

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

Find/-name MySQL
The search results are as follows:
[Root@localhost ~]# Find/-name MySQL
/var/lib/mysql
/var/lib/mysql/mysql
/usr/lib64/mysql

Delete the corresponding MySQL directory
Rm-rf/var/lib/mysql
Rm-rf/var/lib/mysql
Rm-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
Rm-rf/etc/my.cnf

4. Find out if the machine installs MySQL again

Rpm-qa|grep-i MySQL
No results, instructions have been uninstalled thoroughly, next install MySQL directly

How to completely remove MySQL under Linux

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.