安装完mysql 以后,登录之后,无论运行任何命令,老是提示这个html
step 1: SET PASSWORD = PASSWORD('your new password');mysql
step 2: ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;sql
step 3: flush privileges;ide
完成以上三步退出再登,使用新设置的密码就好了,以上除了红色的本身修改为新密码外,其余原样输入便可post
参考1: https://dev.mysql.com/doc/refman/5.6/en/alter-user.htmlthis
参考2: http://dev.mysql.com/doc/refman/5.7/en/password-expiration-policy.htmlurl
参考3: http://stackoverflow.com/questions/33467337/reset-mysql-root-password-using-alter-user-statement-after-install-on-macspa