删除linux中mysql并安装

该解决方案为卸载重装;如果看客不能卸载,请直接关闭
系统:Centos 6.9
MySQL 版本:MySQL 5.7
卸载方法:
1.快速删除
yum remove mysql mysql-server mysql-libs mysql-server
2.查找残留文件
rpm -qa | grep -i mysql
3.将查询出来的文件逐个删除,如:
yum remove mysql-community-common-5.7.20-1.el6.x86_64
4.查找残留目录
whereis mysql
5.逐条删除目录,如:
rm –rf /usr/lib64/mysql

上述做完后,最好重新查询相关内容,防止漏删

安装:
转自 https://segmentfault.com/a/1190000003049498

1.检测系统是否存在mysql

yum list installed | grep mysql

2.如果存在那么删除mysql依赖项

yum -y remove XXXXXX

3.给CentOS添加rpm源,并且选择较新的源

wget dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
yum localinstall mysql-community-release-el6-5.noarch.rpm
yum repolist all | grep mysql
yum-config-manager --disable mysql55-community
yum-config-manager --disable mysql56-community
yum-config-manager --enable mysql57-community-dmr
yum repolist enabled | grep mysql

4.安装mysql 服务器
yum install mysql-community-server

完成

https://www.jianshu.com/p/7b8c4dea6829

猜你喜欢

转载自blog.csdn.net/dingjianjin/article/details/89333684
0条评论
添加一条新回复