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