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
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
注意:第一次执行该脚本时,输入密码是⑤步骤查看的
⑦刷新权限 能让其他主机连接该数据库
grant all privileges on . to 'root'@'%' identity by '密码'; flush privileges;⑧防火墙策略iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT