创建新用户时遇到:
mysql> create user 'test'@'localhost' identified by 'Yt19800304';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
处理办法:
step1;设置安全级别
set global validate_password_policy=0;
2.设置密码长度
默认密码长度为8,可以设置为其它值,最小4位
set global validate_password_length=8;
3.创建新用户并设置新密码
mysql> create user 'liu3'@'localhost' identified by 'Yt19800304';
Query OK, 0 rows affected (0.02 sec)
show grants for liu3 @localhost;显示对用户的授权情况;
grant update,delete on king.pycho to liu3;;将数据库king下指定表的查询、删除权授给用户;
revoke delete on king.pycho from liu3@localhost;使用revoke from撤销授权;
set password for liu3@localhost = password('Yt19840304’);修改用户的密码;