Home > Database > Mysql Tutorial > MySql5.6操作时报错:You must SET PASSWORD before executing t

MySql5.6操作时报错:You must SET PASSWORD before executing t

WBOY
Release: 2016-06-07 15:07:11
Original
1162 people have browsed it

参考前文利用安全模式成功登陆,然后修改密码,等于给MySql设置了密码。登陆进去后,想创建一个数据库测试下。得到的结果确实: ERROR 1820 (HY000): You must SET PASSWORD before executing this statement 非常诡异啊,明明用密码登陆进去了,怎么还提示

参考前文利用安全模式成功登陆,然后修改密码,等于给MySql设置了密码。登陆进去后,想创建一个数据库测试下。得到的结果确实:

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 yan1;
Query OK, 1 row affected (0.00 sec)

也就是用mysql>  SET PASSWORD = PASSWORD('123456');这句话重新设置一次密码!大爷的,真费劲啊。
这位仁兄也遇到了相同的问题。



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template