How to completely delete mysql from Centos

Source: Internet
Author: User

How to completely delete mysql from Centos

1. MySQL installed in yum Mode

$ Yum remove mysql-server mysql-libs compat-mysql51

$ Rm-rf/var/lib/mysq

$ Rm/etc/my. cnf

Check whether there is any mysql software:

$ Rpm-qa | grep mysql

If yes, continue to delete it. The deletion method is yum remove + [name ].

2. mysql installed in rpm Mode

A) Check whether mysql is installed with an rpm package in the system:

[Root @ localhost opt] # rpm-qa | grep-I mysql
MySQL-server-5.6.17-1.el6.i686
MySQL-client-5.6.17-1.el6.i686

B) uninstall mysql

[Root @ localhost local] # rpm-e MySQL-server-5.6.17-1.el6.i686
[Root @ localhost local] # rpm-e MySQL-client-5.6.17-1.el6.i686

C) delete the mysql Service

[Root @ localhost local] # chkconfig -- list | grep-I mysql
[Root @ localhost local] # chkconfig -- del mysql

D) Delete the scattered mysql folder.

[Root @ localhost local] # whereis mysql or find/-name mysql

Mysql:/usr/lib/mysql/usr/share/mysql

Clear all related mysql directories and files
Rm-rf/usr/lib/mysql
Rm-rf/usr/share/mysql

Rm-rf/usr/my. cnf

After completing the steps above, mysql should have been completely uninstalled.

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.