标签:
yum list installed | grep mysql
看看) yum remove mysql mysql-server mysql-libs mysql-server;`
yum -y remove mysql-libs.x86_64`
find / -name mysql
将找到的相关东西全删掉,尤其是后缀为sock的文件所在的文件夹,不然安装新版本后可能不能重启
You need to install yum-utils to use yum-config-manager
,就得先安装yum-utils
) 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 repolist all | grep mysql
后没有内容,说明其实yum是没有更新的,那就只能手动添加源了,过程如下:
rpm -Uvh mysql57-community-release-el6-n.noarch.rpm //1、更新rpm源
找到/etc/yum.repos.d/mysql-community.repo
文件 (要是文件夹和文件都不存在,就自己建立) 写入:
[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-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
yum install mysql-community-server
如果是最小安装情况下,这时候很可能在下载后需要按下Y/N后报错:epel-release is not installed
那就要安装epel-release:yum install epel-release
然后报错有可能就变成:[Errno 14] Could not open/read file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
这种情况下,找到/etc/yum.repos.d/epel.repo
文件夹,写入:
```
[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/
enabled=1
gpgcheck=0 //这里是重点,必须调整成0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
```
然后再yum install mysql-community-server
就可以成功了
/etc/my.cnf
里配置service mysqld start
chkconfig --list | grep mysqld
chkconfig mysqld on
mysql_secure_installation
标签:
原文地址:http://www.cnblogs.com/JohannaFeng/p/5642043.html