美文网首页
centos 安装mysql5.7

centos 安装mysql5.7

作者: 6c0fe9142f09 | 来源:发表于2018-07-17 13:31 被阅读14次

安装

yum -y install https://repo.mysql.com/mysql57-community-release-el6-11.noarch.rpm
yum update -y
yum -y install mysql-community-server
service mysqld start

查看密码

grep 'temporary password' /var/log/mysqld.log
# 显示如下
2017-12-20T15:32:24.436697Z 1 [Note] A temporary password is generated for root@localhost: th.otyKdt0f.
mysql -uroot -p
# 输入上面生成的密码登录

密码就是:th.otyKdt0f.

修改密码

ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';

修改远程登录

use mysql;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH PRIVILEGES; 
quit();

service mysqld restart
service iptables stop

相关文章

网友评论

      本文标题:centos 安装mysql5.7

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