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';