ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
2014-12-03 17:56
435 查看
从MySql5.6.6起可以强制用户修改密码。
Session1:先使密码过期
mysql>ALTER USER 'test'@'127.0.0.1' PASSWORD EXPIRE;
Session2:可以继续操作,这个操作不会影响已建立的连接
mysql> select 1 \G
*************************** 1. row ***************************
1: 1
1 row in set (0.01 sec)
Session3:会影响新的连接
mysql -utest -p
Enter password: ******
mysql> show variables like'port'\G;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
当出现ERROR 1820 (HY000)这个错误后,用SET PASSWORD 修改当前用户的密码就可以了。
mysql> SET PASSWORD = PASSWORD('123456');
Query OK, 0 rows affected (0.04 sec)
mysql> select 1 \G
*************************** 1. row ***************************
1: 1
1 row in set (0.01 sec)
Session1:先使密码过期
mysql>ALTER USER 'test'@'127.0.0.1' PASSWORD EXPIRE;
Session2:可以继续操作,这个操作不会影响已建立的连接
mysql> select 1 \G
*************************** 1. row ***************************
1: 1
1 row in set (0.01 sec)
Session3:会影响新的连接
mysql -utest -p
Enter password: ******
mysql> show variables like'port'\G;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
当出现ERROR 1820 (HY000)这个错误后,用SET PASSWORD 修改当前用户的密码就可以了。
mysql> SET PASSWORD = PASSWORD('123456');
Query OK, 0 rows affected (0.04 sec)
mysql> select 1 \G
*************************** 1. row ***************************
1: 1
1 row in set (0.01 sec)
相关文章推荐
- Mysql 密码报错ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
- mysql:ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
- MySql5.7 ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
- ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
- ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
- ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
- 解决mysql,出现错误 ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
- ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
- linux mysql 报错ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
- mysql安装过程中出现错误 ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
- ubuntu14.10下解决"ERROR 1820 (HY000): You must SET PASSWORD before executing this statement"
- mysql安装过程中出现错误ERROR 1820 (HY000): You must SET PASSWORD before executing this statement解决
- ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
- ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
- ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
- mysql密码丢失 ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
- ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
- ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
- ERROR 1820 (HY000): You must SET PASSWORD before executing this
- ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.