How to thoroughly uninstall mysql in linux

Source: Internet
Author: User

How to thoroughly uninstall mysql in linux
1. Check whether mysql is installed before.

Run the: yum remove mysql * command to uninstall mysql and related components.

Command: rpm-qa | grep-I mysql
As shown in:

Note:
MySQL-client-5.5.25a-1.rhel5
MySQL-server-5.5.25a-1.rhel5

2. Stop the mysql service and 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. Search for the directories of earlier mysql versions and delete the files and libraries of earlier mysql versions.

Find/-name mysql
The search result is as follows:
[Root @ localhost ~] # Find/-name mysql
/Var/lib/mysql
/Var/lib/mysql
/Usr/lib64/mysql

Delete the corresponding mysql directory
Rm-rf/var/lib/mysql
Rm-rf/var/lib/mysql
Rm-rf/usr/lib64/mysql
Perform specific steps to find and delete the Directory

Note: After uninstallation,/etc/my. cnf is not deleted and must be manually deleted.
Rm-rf/etc/my. cnf

4. Check whether mysql is installed on the machine again.

Rpm-qa | grep-I mysql
No results. It indicates that the installation is complete, and you can install mysql directly.





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.