mysql賦權(quán)報(bào)錯(cuò)
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版本中新增了一個(gè)system_user帳戶類型愚墓,當(dāng)我通過(guò)phpAdmin新增用戶并賦予權(quán)限時(shí)
CREATE USER 'homestead'@'%' IDENTIFIED WITH caching_sha2_password BY '***';
GRANT ALL PRIVILEGES ON *.* TO 'homestead'@'%' WITH GRANT OPTION;
這個(gè)時(shí)候系統(tǒng)會(huì)報(bào)錯(cuò):
1227 - Access denied; you need (at least one of) the SYSTEM_USER privilege(s) for this operation
查閱了一下官方文檔,原因是由于root用戶沒(méi)有SYSTEM_USER權(quán)限天吓,把權(quán)限加入后即可解決:
grant system_user on *.* to 'root';