Delete mysql_MySQL in linux

Source: Internet
Author: User
Delete mysql bitsCN.com in linux

Like installing many software, if it is the second installation, it is much more complicated than the first installation. many things may not be installed because they are not deleted. this installation is an example.

The following describes how to delete a clean object:

1. delete rpm

Use rpm-qa | grep mysql to view the installed rpm Package

Reuse (note that only the client is in front)

Rpm e MySQL-client-community-5.1.40-0.rhel5

Rpm e MySQL-server-community-5.1.40-0.rhel5

Two commands are used to delete the server and client.

2. delete the development header files and libraries of earlier versions.

It is certain that, with the deletion of the above two rpm packages, many mysql headers and mysql folders under/usr/bin/will be deleted, however, some items that will not be deleted by default are as follows:

Whether there is a mysql folder under/var/lib. here is the development library of the old version.

Whether the my. cnf file exists under/etc/is the configuration file of the old version.

Run the rm command to delete all the above files.

3. delete the mysql process that may still be running-this is the easiest place to ignore

You can use ps-ef | grep mysql to view

-Bash-3.1 # ps-ef | grep mysql

Root 4885 1 0 :43? 00:00:00/bin/sh bin/mysqld_safe -- user = mysql

Mysql 4984 4885 0? 00:00:00/usr/local/mysql/bin/mysqld -- basedir =/usr/local/mysql -- datadir =/usr/local/mysql/data -- user = mysql -- log-error = /usr/local/mysql/data/namenode. err -- pid-file =/usr/local/mysql/data/namenode. pid -- socket =/tmp/mysql. sock -- ports = 3306

Root 8116 7066 0 00:00:00 pts/1 grep mysql

Kill all of them when there are more than one.

Otherwise, a startup error will be reported when you install the rpm Package of the server. the last two lines of my error are as follows:

Starting MySQL.. Manager of pid-file quit without updating file. [failed]

Giving mysqld 2 seconds to start.

BitsCN.com

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.