# 安装MySQL的yum源,下面是RHEL6系列的下载地址
rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
# 安装yum-config-manager
yum install yum-utils -y
# 禁用MySQL5.6的源
yum-config-manager --disable mysql56-community
# 启用MySQL5.7的源
yum-config-manager --enable mysql57-community-dmr
# 用下面的命令查看是否配置正确 如图所示就ok
yum repolist enabled | grep mysql
![](https://img-blog.csdn.net/20170126194731786?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcXFfMzYwMzAyODg=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
# 禁用selinux
setenforce 0
sed -i '/^SELINUX=/c\SELINUX=disabled' /etc/selinux/config
# 启动mysqld,启动之前先修改/etc/my.cnf配置文件,本文用默认的配置
service mysqld start
# 查看mysql自动为你生成的随机密码
grep "password" /var/log/mysqld.log
# 以上步骤结束后,可以使用root用户登录mysql试试了
mysql -u root -p
#设置你的新密码
SET PASSWORD = PASSWORD('new password');
#mysql5.7.+的版本性能有着很大的提升