一、关闭MySQL
[root@localhost /]# service mysqld stop
Redirecting to /bin/systemctl stop mysqld.service
二、查看当前安装mysql情况,查找以前是否装有mysql
[root@localhost /]# rpm -qa|grep -i mysql
mysql-community-client-8.0.13-1.el7.x86_64
mysql-community-libs-8.0.13-1.el7.x86_64
mysql-community-common-8.0.13-1.el7.x86_64
mysql-community-server-8.0.13-1.el7.x86_64
三、执行命令删除安装的MySQL
[root@localhost /]# rpm -ev mysql-community-client-8.0.13-1.el7.x86_64
报错:
error: Failed dependencies:
mysql-community-client(x86-64) >= 8.0.0 is needed by (installed) mysql-community-server-8.0.13-1.el7.x86_64