美文网首页
mysql赋权报错ERROR 1227 (42000): Acc

mysql赋权报错ERROR 1227 (42000): Acc

作者: 运维之美 | 来源:发表于2021-04-01 19:33 被阅读0次

    mysql赋权报错
    ERROR 1227 (42000): Access denied; you need (at least one of) the SYSTEM_USER privilege(s) for this operation

    mysql> GRANT ALL PRIVILEGES ON  *.* TO 'test'@'%';
    ERROR 1227 (42000): Access denied; you need (at least one of) the SYSTEM_USER privilege(s) for this operation
    mysql> GRANT ALL PRIVILEGES ON  *.* TO 'test'@'%';
    Query OK, 0 rows affected (0.06 sec)
    

    按照如下操作后解决
    MySQL8.0.16版本中新增了一个system_user帐户类型,当我通过phpAdmin新增用户并赋予权限时

      CREATE USER 'homestead'@'%' IDENTIFIED WITH caching_sha2_password BY '***';
     GRANT ALL PRIVILEGES ON *.* TO 'homestead'@'%' WITH GRANT OPTION;
    

    这个时候系统会报错:

    1227 - Access denied; you need (at least one of) the SYSTEM_USER privilege(s) for this operation
    查阅了一下官方文档,原因是由于root用户没有SYSTEM_USER权限,把权限加入后即可解决:

    grant system_user on *.* to 'root';
    
    

    相关文章

      网友评论

          本文标题:mysql赋权报错ERROR 1227 (42000): Acc

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