centos7安装mysql5.7在线

2019-01-18  本文已影响3人  小知大知

1. 安装

wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql-community-server

#启动
systemctl start  mysqld.service
#状态
systemctl status mysqld.service
#查看默认登陆密码
grep "password" /var/log/mysqld.log
#设置密码
 mysql -uroot -p
 set password=password("youpassword");
 flush privileges

#开机启动
 systemctl enable mysqld
 systemctl daemon-reload

Host is not allowed to connect to this MySQL server解决方法

#防火墙加入3306
firewall-cmd --list-ports
firewall-cmd --zone=public --add-port=3306/tcp --permanent
firewall-cmd --reload
#设置mysql
use mysql
update user set host = '%' where user = 'root';
flush privileges

参考链接https://www.cnblogs.com/luohanguo/p/9045391.html

上一篇 下一篇

猜你喜欢

热点阅读