标签:mys 服务 gen 重启 使用 cti length text root
# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm # rpm -ivh mysql-community-release-el7-5.noarch.rpm # yum install mysql-community-server
安装成功后重启mysql服务。 # service mysqld restart
安装完毕后 使用(systemctl status mysqld.service)查询数据库状态 若出现绿色字符( active (running))为正常启动
mysql -u root 进入数据库! 初始密码查询(grep "password" /var/log/mysqld.log) 如下(黄色为初始密码):
[root@centos7-1 ~]# grep "password" /var/log/mysqld.log
2019-08-13T11:07:27.895083Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: xkjty)i9Pe(c
因为centos7中使用了密码简易规则 所以设置1234这种简单的密码时会报错(Your password does not satisfy the current policy requirements)
所以我们在进入数据库前通过两条命令来修改一下密码规则
(set global validate_password_policy=0;)
(set global validate_password_length=1;)
接着进去数据库 设置密码(ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘123456‘;)
============================================ok!!!===========================================
标签:mys 服务 gen 重启 使用 cti length text root
原文地址:https://www.cnblogs.com/xiaolizikj/p/11348120.html