yum install http://dev.MysqL.com/get/MysqL57-community-release-el6-9.noarch.rpm
yum repolist all | grep MysqL
yum install MysqL-community-server
service MysqLd start
搜索默认初始密码
grep 'temporary password' /var/log/MysqLd.log
2016-11-26T16:01:37.738626Z 1 [Note] A temporary password is generated for root@localhost: M4ym/:3h72mx [root@bogon ~]# MysqL -uroot -pM4ym/:3h72mx
用默认密码登录
MysqL -uroot -pM4ym/:3h72mx
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';
赋权远程登录
use MysqL;
update user set host = '%' where user ='root';
ip设置: eth0里设置为dhcp,不要复制eh0为eth1去改,否则要修改/etc/udev/rules.d/70-persistent-net.rules。(较新的稳定版本如centos7.2不需要修改)
BOOTPROTO=dhcp 启动网络还不生效则重启虚机
另外一台机器登录,报10060,根据【1】
开放3306端口
/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT;
/etc/init.d/iptables save;
重启防火墙:
service iptables stop;
service iptables start;
再次登录,ok
参考文档 :
1.http://www.zhimengzhe.com/shujuku/MysqL/49454.html MysqL连接报10060错误排查