1.你必须使用的.rpm 包安装的mysql
安装mysql教程
http://blog.csdn.net/m0_37504101/article/details/78113400
1.停止mysql服务
systemctl stop mysqld
1.搜索安装mysql的包
rpm -qa|grep -i mysql
2.卸载
[root@vm-xiluhua][/usr/local/mysql]$ rpm -ivh mysql-community-common-5.7.15-1.el7.x86_64.rpm
警告:mysql-community-common-5.7.15-1.el7.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:mysql-community-common-5.7.15-1.e################################# [100%]
[root@vm-xiluhua][/usr/local/mysql]$ rpm -ivh mysql-community-libs-5.7.15-1.el7.x86_64.rpm
警告:mysql-community-libs-5.7.15-1.el7.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:mysql-community-libs-5.7.15-1.el7################################# [100%]
[root@vm-xiluhua][/usr/local/mysql]$ rpm -ivh mysql-community-server-5.7.15-1.el7.x86_64.rpm
警告:mysql-community-server-5.7.15-1.el7.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY
错误:依赖检测失败:
mysql-community-client(x86-64) >= 5.7.9 被 mysql-community-server-5.7.15-1.el7.x86_64 需要
[root@vm-xiluhua][/usr/local/mysql]$ rpm -ivh mysql-community-client-5.7.15-1.el7.x86_64.rpm
警告:mysql-community-client-5.7.15-1.el7.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:mysql-community-client-5.7.15-1.e################################# [100%]
[root@vm-xiluhua][/usr/local/mysql]$ rpm -ivh mysql-community-server-5.7.15-1.el7.x86_64.rpm
警告:mysql-community-server-5.7.15-1.el7.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:mysql-community-server-5.7.15-1.e################################# [100%]
3.删除剩余文件内容
find / -name mysql
/var/lib/mysql
/var/lib/mysql/mysql
/usr/lib64/mysql
删除这些文件目录
rm -rf /var/lib/mysql
rm -rf /var/lib/mysql
rm -rf /usr/lib64/mysql
最后删除配置文件
rm -rf /etc/my.cnf