Your password does not satisfy the current policy requirements

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
简介:
mysql> create user 'test1'@'localhost' identified by '123456';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

原因:密码策略问题

解决办法:
1.查看mysql初始的密码策略
mysql> show variables like 'validate_password%';
+--------------------------------------+--------+
| Variable_name                        | Value  |
+--------------------------------------+--------+
| validate_password_check_user_name    | OFF    |
| validate_password_dictionary_file    |        |
| validate_password_length             | 8      |
| validate_password_mixed_case_count   | 1      |
| validate_password_number_count       | 1      |
| validate_password_policy             | MEDIUM |
| validate_password_special_char_count | 1      |
+--------------------------------------+--------+
7 rows in set (0.04 sec)

2.设置密码的验证强度等级,设置validate_password_policy的全局参数为LOW
(修改为low后,就只验证密码的长度)
set global validate_password_policy=LOW;

mysql> show variables like 'validate_password%';
+--------------------------------------+-------+
| Variable_name                        | Value |
+--------------------------------------+-------+
| validate_password_check_user_name    | OFF   |
| validate_password_dictionary_file    |       |
| validate_password_length             | 8     |
| validate_password_mixed_case_count   | 1     |
| validate_password_number_count       | 1     |
| validate_password_policy             | LOW   |
| validate_password_special_char_count | 1     |
+--------------------------------------+-------+
7 rows in set (0.00 sec)

3.修改密码长度
set global validate_password_length=6;

mysql> show variables like 'validate_password%';
+--------------------------------------+-------+
| Variable_name                        | Value |
+--------------------------------------+-------+
| validate_password_check_user_name    | OFF   |
| validate_password_dictionary_file    |       |
| validate_password_length             | 6     |
| validate_password_mixed_case_count   | 1     |
| validate_password_number_count       | 1     |
| validate_password_policy             | LOW   |
| validate_password_special_char_count | 1     |
+--------------------------------------+-------+
7 rows in set (0.01 sec)

4.验证
mysql> create user 'test1'@'localhost' identified by '123456';
Query OK, 0 rows affected (0.06 sec)
相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
18天前
|
关系型数据库 MySQL 数据库
mysql Your password does not satisfy the current policy requirements
mysql Your password does not satisfy the current policy requirements
34 13
|
1月前
|
安全 关系型数据库 MySQL
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
14 2
|
10月前
|
关系型数据库 MySQL 数据安全/隐私保护
mysql解决:当你要重置密码时报错Your password does not satisfy the current policy requirements
mysql解决:当你要重置密码时报错Your password does not satisfy the current policy requirements
|
数据安全/隐私保护
remote: Support for password authentication was removed on August 13, 2021
remote: Support for password authentication was removed on August 13, 2021
142 0
|
关系型数据库 MySQL 数据安全/隐私保护
MySQL:ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
MySQL:ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
103 0
Field creation not permitted in partner development mode
Field creation not permitted in partner development mode
Field creation not permitted in partner development mode
|
关系型数据库 MySQL 数据安全/隐私保护