【mysql】You must reset your password using ALTER USER statement before executing this statement.
2017-03-24 09:42
495 查看
故障现场:登陆到MySQL服务器,不管你执行什么命令都报这个错
mysql> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> use test;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
...
...
怎么会这样呢?难道我进的是假服务器?
原因分析:这个主要是由一个参数控制的 default_password_lifetime,看看官方的解释
仔细看哈,Note信息有时候比上面的信息有用(英文的note我一般都是忽略的,有可能你忽略掉的那部分对性能也有帮助哦)
问题解决:在开源的世界里,我们不怕报错,有报错才有解决思路。下面来看下自己环境里的
mysql> select version();
+--------------+
| version() |
+--------------+
| 5.7.10-3-log |
+--------------+
1 row in set (0.01 sec)
mysql> show variables like 'default_password_lifetime';
+---------------------------+-------+
| Variable_name | Value |
+---------------------------+-------+
| default_password_lifetime | 360 |
+---------------------------+-------+
1 row in set (0.00 sec)
soga,原来如此。那么就修改密码呗
alter user user() identified by "123456";
问题得到成功解决!当前用户可以成功执行权限内的命令。
mysql> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> use test;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
...
...
怎么会这样呢?难道我进的是假服务器?
原因分析:这个主要是由一个参数控制的 default_password_lifetime,看看官方的解释
仔细看哈,Note信息有时候比上面的信息有用(英文的note我一般都是忽略的,有可能你忽略掉的那部分对性能也有帮助哦)
问题解决:在开源的世界里,我们不怕报错,有报错才有解决思路。下面来看下自己环境里的
mysql> select version();
+--------------+
| version() |
+--------------+
| 5.7.10-3-log |
+--------------+
1 row in set (0.01 sec)
mysql> show variables like 'default_password_lifetime';
+---------------------------+-------+
| Variable_name | Value |
+---------------------------+-------+
| default_password_lifetime | 360 |
+---------------------------+-------+
1 row in set (0.00 sec)
soga,原来如此。那么就修改密码呗
alter user user() identified by "123456";
问题得到成功解决!当前用户可以成功执行权限内的命令。
相关文章推荐
- mac mysql error You must reset your password using ALTER USER statement before executing this statement.
- mysql 5.7安装后,出现You must reset your password using ALTER USER statement before executing this stateme
- 第一次登录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 this statement.
- mac mysql error You must reset your password using ALTER USER statement before executing this statement.
- mysql5.7 You must reset your password using ALTER USER statement before executing this statement.
- mysql 设置不了短串密码怎么办 You must reset your password using ALTER USER statement before executing this statement.
- 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 statem
- mac mysql error You must reset your password using ALTER USER statement before executing this statem
- 错误mac mysql error You must reset your password using ALTER USER statement before executing this stat
- MySQL错误: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
- ERROR 1820 (HY000): 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.
- 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.
- 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 You must reset you ac6f r password using ALTER USER statement before executing this statement.