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';