Uninstall the built-in MySQL on the linux system

Recently, I am learning to use Linux and install MySQL in the Linux system. Linux will come with MySQL, but the version is too low. So I want to delete the MySQL that comes with Linux to prevent conflicts when installing MySQL later.
Steps:
1. Switch identity to root user

 su root

2. Enter the rpm -qa|grep -i mysql command to check the mysql plug-ins contained in the system, press Enter, if there is no built-in mysql, the system is very clean. If it is displayed, there is a mysql plug-in.

[root@localhost /]# rpm -qa|grep -i mysql
mysql-libs-5.1.71-1.el6.x86_64

3. Enter rpm -ev to uninstall the built-in mysql plug-in copy command that just appeared. [I did not succeed in executing this command here]

[root@localhost /]# rpm -ev mysql-libs-5.1.71-1.el6.x86_64
error: Failed dependencies:
	libmysqlclient.so.16()(64bit) is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64
	libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64
	mysql-libs is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64

3. If the command is invalid or wrong, enter rpm -e --nodeps to uninstall the built-in mysql plug-in copy command that just appeared.

[root@localhost /]# rpm -e --nodeps mysql-libs-5.1.71-1.el6.x86_64

4. Enter the find / -name mysql command to find the installation directory command related to the old version mysql, if not found, then ok;

[root@localhost /]# rpm -e --nodeps mysql-libs-5.1.71-1.el6.x86_64
[root@localhost /]# find / -name mysql
[root@localhost /]# yum list installed | grep mysql

4. If the relevant directory is found, enter the rm -rf directory name command to enter the /etc/ directory to check whether the mysql configuration file my.cnf exists. If it exists, enter the rm -f my.cnf command to delete it.

Guess you like

Origin blog.csdn.net/chengshiruxia/article/details/112244158