The steps for uninstalling MySQL in CentOS Binary Package/source code installation are as follows: centosmysql

Source: Internet
Author: User

The steps for uninstalling MySQL in CentOS Binary Package/source code installation are as follows: centosmysql

View the mysql running status of the current system

[root@zendlinux ~]# ps -ef |grep mysqlroot 1153 1 0 15:40 ? 00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/var --pid-file=/usr/local/mysql/var/zendlinux.pidmysql 1695 1153 0 15:40 ? 00:00:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/var --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/var/zendlinux.err --open-files-limit=65535 --pid-file=/usr/local/mysql/var/zendlinux.pid --socket=/tmp/mysql.sock --port=3306root 1736 1716 0 15:53 pts/0 00:00:00 grep mysql

View the status of mysqld and disable

[root@zendlinux ~]# service mysqld statusSUCCESS! MySQL running (1695)[root@zendlinux ~]# service mysqld stopShutting down MySQL. SUCCESS! 

View startup status

[root@zendlinux ~]# chkconfig --list |grep -i mysqlmysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off

Find the MySQL installation directory and delete it permanently

[root@zendlinux ~]# whereis mysqlmysql: /usr/bin/mysql /usr/lib/mysql /usr/include/mysql /usr/local/mysql[root@zendlinux ~]# find / -name mysql/var/spool/mail/mysql/usr/lib/mysql/usr/include/mysql/usr/local/mysql/usr/local/mysql/var/mysql/usr/local/mysql/include/mysql/usr/local/mysql/bin/mysql/usr/bin/mysql[root@zendlinux ~]# rm -rf /usr/bin/mysql /usr/local/mysql /usr/include/mysql /var/spool/mail/mysql /usr/lib/mysql[root@zendlinux ~]# find / -name mysql

Delete some configuration files
The configuration files include/etc/my. cnf or/etc/init. d/mysqld, depending on the specific installation configuration.

[root@zendlinux ~]# rm -rf /etc/my.cnf[root@zendlinux ~]# rm -rf /etc/init.d/mysqld

Delete MySQL users and user groups

[root@zendlinux ~]# id mysqluid=500(mysql) gid=500(mysql) groups=500(mysql)[root@zendlinux ~]# userdel mysql[root@zendlinux ~]# id mysql

  

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.