美文网首页
mysql 设置密码

mysql 设置密码

作者: 玩玩风行啦 | 来源:发表于2018-07-24 12:03 被阅读13次
mysql 8.0.11

$ mysql -h 10.86.1.24 -u root -p 
Enter password: 
ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory


mysql> ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

mysql> show variables like 'validate_password_policy';
+--------------------------+--------+
| Variable_name            | Value  |
+--------------------------+--------+
| validate_password_policy | MEDIUM |
+--------------------------+--------+
1 row in set (0.01 sec)

mysql> set global validate_password_policy=0;
Query OK, 0 rows affected (0.00 sec)

mysql> show variables like 'validate_password_policy';
+--------------------------+-------+
| Variable_name            | Value |
+--------------------------+-------+
| validate_password_policy | LOW   |
+--------------------------+-------+
1 row in set (0.00 sec)

mysql> ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';
Query OK, 0 rows affected (0.07 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

相关文章

网友评论

      本文标题:mysql 设置密码

      本文链接:https://www.haomeiwen.com/subject/phpemftx.html