【MySQL】ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing
2017-11-10 15:31
537 查看
今天上午遇到了一个问题,新创建的mysql5.7的数据库,由于初始化有点问题,没有给root密码,用了免密码登录。
但是,修改了root密码之后,把配置中的免密登录的配置注释掉后,重启服务。服务正常启动,用修改后的密码也可以正常登录,
但是执行任何操作,都提示:
mysql > show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing
我嘞个懵逼了,为啥出现这个错误啊!
后来找了很多帖子,其中有一个完美解决了问题:
参考官方的一个文档,见http://dev.mysql.com/doc/refman/5.6/en/alter-user.html。如下操作后就ok了:
mysql> SET PASSWORD = PASSWORD('123456');
Query OK, 0 rows affected (0.03 sec)
但是,修改了root密码之后,把配置中的免密登录的配置注释掉后,重启服务。服务正常启动,用修改后的密码也可以正常登录,
但是执行任何操作,都提示:
mysql > show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing
我嘞个懵逼了,为啥出现这个错误啊!
后来找了很多帖子,其中有一个完美解决了问题:
参考官方的一个文档,见http://dev.mysql.com/doc/refman/5.6/en/alter-user.html。如下操作后就ok了:
mysql> SET PASSWORD = PASSWORD('123456');
Query OK, 0 rows affected (0.03 sec)
相关文章推荐
- MySQL用户密码过期登陆报错ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
- mysql中ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing t
- mysql 报错ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing
- 第一次登录mysql,使用任何命令都报错ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
- [mysql] ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing
- MYSQL 报错ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executin
- MySQL5.7 错误:ERROR 1820 (HY000): You must reset your password using ALTER USER statement before ...
- ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this ..
- ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this st
- mysql 报错ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executin
- ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
- MySQL 报错 ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executin
- ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
- mysql 5.7 ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executi
- 错误mac mysql error You must reset your password using ALTER USER statement before executing this stat
- mac mysql error You must reset your password using ALTER USER statement before executing this statement.
- mac mysql error You must reset your password using ALTER USER statement before executing this statement.
- ERROR 1820 (HY000): You must reset your password using ALTER USER statement befo re executing this s
- mac mysql error You must reset your password using ALTER USER statement before executing this statem
- 5.7 以后的MYSQL 登录数据库还是报错ERROR 1820 (HY000): You must reset your password using ALTER USER statement be