MySql5.6操作时报错:You must SET PASSWORD before executing this statement解决

mysql5.6 密码登录后操作报错。

报错信息:ERROR 1820 (HY000): You must SET PASSWORD before executing this statement

非常诡异啊,明明用密码登陆进去了,怎么还提示需要密码。
参考官方的一个文档,见http://dev.mysql.com/doc/refman/5.6/en/alter-user.html。如下操作后就ok了:

mysql> create database yan1;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
mysql>  SET PASSWORD = PASSWORD('123456');
Query OK, 0 rows affected (0.03 sec)

mysql> create database TMS;
Query OK, 1 row affected (0.00 sec)

也就是用mysql> SET PASSWORD = PASSWORD(‘123456’);这句话重新设置一次密码!

© 版权声明
THE END
喜欢就支持一下吧
点赞0赞赏
分享
评论 抢沙发