1 yum -y install wget
2 wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
3 yum -y install mysql57-community-release-el7-10.noarch.rpm
4 yum -y install mysql-community-server
5 service mysqld start
6 netstat -nltp | grep 3306
7 grep "password" /var/log/mysqld.log 查看原始密码
grep "password" /var/log/mysqld.log
2020-09-16T10:07:10.040017Z 1 [Note] A temporary password is generated for root@localhost: hlLE+rs,5Bii(这是初始密码)8 登录 mysql -uroot -phlLE+rs,5Bii
9 修改密码:若是设置简单密码,比如root这种,需要先修改验证
mysql> set global validate_password_policy=0; mysql> set global validate_password_length=1; 这个两个设置以后 密码很简单不会报错
10 ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';设置密码为root
CentOS7使用yum安装mysql5.7
最新推荐文章于 2024-08-31 23:40:08 发布