安装环境:CentOS 7 64位 安装MySQL5.7
第一步,在MySQL官网中下载YUM源rpm安装包:https://dev.mysql.com/downloads/repo/yum/
其他下载地址:http://mirrors.sohu.com/mysql/MySQL-5.7/ (参考:http://jingyan.baidu.com/article/4665065825c740f549e5f830.html)
下载mysql源安装包
shell> wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
安装mysql源
shell> yum mysql57-community-release-el7-11.noarch.rpm
检查mysql源是否安装成功
shell> yum repolist enabled | grep "mysql.*-community.*"
!mysql-connectors-community/x86_64 MySQL Connectors Community 42
!mysql-tools-community/x86_64 MySQL Tools Community 51
!mysql57-community/x86_64 MySQL 5.7 Community Server 207
看到上面所示表示安装成功。
可以查看vim /etc/yum.repos.d/mysql-community.repo源,不需要修改。
(如果需要可以改变默认安装的mysql版本。比如要安装5.6版本,将5.7源的enabled=1改成enabled=0。然后再将5.6源