美文网首页
centos7安装mysql5.7在线

centos7安装mysql5.7在线

作者: 小知大知 | 来源:发表于2019-01-18 15:57 被阅读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

相关文章

网友评论

      本文标题:centos7安装mysql5.7在线

      本文链接:https://www.haomeiwen.com/subject/qqvndqtx.html