文档首页> 云数据库 RDS> 故障排除> RDS for MySQL> 连接类> 通过DAS授权或取消授权时报错Your password does not satisfy the current policy requirements
更新时间:2024-02-19 GMT+08:00
分享

通过DAS授权或取消授权时报错Your password does not satisfy the current policy requirements

场景描述

在DAS上使用root登录数据库进行GRANT授权或者REVOKE取消授权时,报错:Your password does not satisfy the current policy requirements

解决方案

  • MySQL 5.7

    在没有创建用户的前提下授权,会提示:Your password does not satisfy the current policy requirements

    5.7版本的GRANT语句会在用户不存在的时候自动创建用户,建议在授权命令后面加上IDENTIFIED BY,此时用户就被创建成功。

    查询用户是否存在:

    select * from mysql.user where user='<username>';

    授权语句:

    grant select on mysql.* to '<username>'@'%' IDENTIFIED BY '<password>';

  • MySQL 8.0

    在没有创建用户的前提下授权,会提示:You are not allowed to create a user with GRANT

    8.0版本需要先create创建用户再执行授权。

分享:

    相关文档

    相关产品