精简版centos6.5安装mysql5.7直至远程登录成功

前端之家收集整理的这篇文章主要介绍了精简版centos6.5安装mysql5.7直至远程登录成功前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

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错误排查

猜你在找的CentOS相关文章