centos7对mysql进行在线升级:
①下载mysql源
wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
②安装mysql5.7源
yum localinstall -y mysql57-community-release-el7-7.noarch.rpm
③安装数据库服务器
yum install -y mysql-community-server
④启动数据库服务
systemctl start mysqld.service
⑤防火墙策略
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
⑥查看临时密码
grep 'temporary password' /var/log/mysqld.log
⑦执行安全脚本,并修改密码
mysql_secure_installation
注意:第一次执行该脚本时,输入密码是⑤步骤查看的
⑧刷新权限 能让其他主机连接该数据库
GRANT ALL PRIVILEGES ON . TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
flush privileges;

centos6.X对mysql进行在线升级
①下载mysql源
wget http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm
②安装mysql5.7源
yum localinstall -y mysql57-community-release-el6-7.noarch.rpm
③安装数据库服务器
yum install -y mysql-community-server
④启动数据库服务
service mysqld start
⑤查看临时密码
grep 'temporary password' /var/log/mysqld.log
⑥执行安全脚本,并修改密码
mysql_secure_installation
注意:第一次执行该脚本时,输入密码是⑤步骤查看的
centos6、7在线升级mysql到mysql5.7
⑦刷新权限 能让其他主机连接该数据库
GRANT ALL PRIVILEGES ON . TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
flush privileges;
⑧防火墙策略
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT