grep 'temporary password' /var/log/mysqld.log
用该密码登录到服务端后,必须马上修改密码,不然会报如下错误:
mysql> select @@log_error; ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement. mysql>
修改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root123';