grep 'temporary password' /var/log/mysqld.log mysql -uroot -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass1!'; 或 set password for 'root'@'localhost'=password('MyNewPass1!'); mysql> use mysql; mysql> update user set password=PASSWORD('MyNewPass2!') where user='root'; mysql> flush privileges;