1. 程式人生 > >You must reset your password using ALTER USER statement before executing this statement.

You must reset your password using ALTER USER statement before executing this statement.

tac ges body 安裝 ins https efm root ati

安裝完mysql 之後,登陸以後,不管運行任何命令,總是提示這個

step 1: SET PASSWORD = PASSWORD(‘your new password‘);

step 2: ALTER USER ‘root‘@‘localhost‘ PASSWORD EXPIRE NEVER;

step 3: flush privileges;

完成以上三步退出再登,使用新設置的密碼就行了,以上除了紅色的自己修改成新密碼外,其他原樣輸入即可

參考1: https://dev.mysql.com/doc/refman/5.6/en/alter-user.html

參考2: http://dev.mysql.com/doc/refman/5.7/en/password-expiration-policy.html

參考3: http://stackoverflow.com/questions/33467337/reset-mysql-root-password-using-alter-user-statement-after-install-on-mac

You must reset your password using ALTER USER statement before executing this statement.