yum install -y https://repo.mysql.com/mysql-community-release-el7.rpm yum install -y mysql-community-server systemctl enable mysqld systemctl start mysqld # 找临时密码 cat /var/log/mysqld.log mysql -p 输入密码 set global validate_password.policy=0; set global validate_password.length=1; alter user 'root'@'localhost' identified by '新密码'; mysql -u root -p