MySQL给用户添加某个数据库的权限、ERROR1819 (HY000): Your password does not satisfy the current policy requirements

一、ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

MySQL给用户添加某个数据库的权限、ERROR1819 (HY000): Your password does not satisfy the current policy requirements

原因是因为密码设置的过于简单会报错,MySQL有密码设置的规范,具体是与validate_password_policy的值有关,下图表明该值规则:

MySQL给用户添加某个数据库的权限、ERROR1819 (HY000): Your password does not satisfy the current policy requirements

如果想要查看MySQL完整的初始密码规则,登陆后执行以下命令:

SHOW VARIABLES LIKE 'validate_password%';

MySQL给用户添加某个数据库的权限、ERROR1819 (HY000): Your password does not satisfy the current policy requirements

密码的长度是由validate_password_length决定的, validate_password_policy决定密码的验证策略,默认等级为MEDIUM(中等),可通过以下命令修改为LOW(低)

set global validate_password_policy=0;

MySQL给用户添加某个数据库的权限、ERROR1819 (HY000): Your password does not satisfy the current policy requirements

二、MySQL 给用户添加某个数据库的权限

第一步:使用root用户进入mysql

第二步:添加用户权限,其中 passenger_flow_analysis (数据库的名字),pfa(用户名), pfa123qwe (密码)

grant all privileges on passenger_flow_analysis.* to 'pfa'@'%' identified by 'pfa123qwe' with grant option;

第三步:刷新权限

flush privileges;

MySQL给用户添加某个数据库的权限、ERROR1819 (HY000): Your password does not satisfy the current policy requirements