安装mysql(7.33)
1)yum -y install mysql57-community-release-el7-11.noarch.rpm
2)yum -y install mysql-community-server
查看mysql原始密码
1)systemctl status mysqld.service(查看状态)
2)systemctl daemon-reload
3)systemctl enable mysqld
4)grep ‘temporary password’ /var/log/mysqld.log(查看日志中的root密码)
mysql -u root -p (进入mysql系统设置界面)
设置密码太简单解决方法
1)SHOW VARIABLES LIKE ‘validate_password%’;
2)set global validate_password_policy=LOW;
3)set global validate_password_length=6;
4)ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘admin2020’;(修改root密码)