首次登陆mysql,并设置mysql为任意位置可访问
# service mysql start
# mysql –u root –p (回车后输入密码,建议从.mysql_secret文件中拷贝,手打的容易出错)
Mysql> set password = password("123456")
Mysql> exit;
# mysql –u root –p (回车后输入新密码123456)
Mysql> grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;
Mysql> flush privileges;
# systemctl start firewalld.service /启动firewall
# systemctl stop firewalld.service /停止firewall
# systemctl disable firewalld.service /禁止firewall开机启动
# firewall-cmd --zone=public –add-port=3306/tcp –permanent /开启3306端口
# firewall-cmd –reload /重新载入以生效