mysql 没有grant权限

1
2
3
show grants for root@"%";
GRANT Grant Option ON *.* TO `root`@`%`;
ERROR 1045 (28000): Access denied

解决:

1
2
3
select user,host,Grant_priv from user; 
update mysql.user set Grant_priv="Y" where user="root" and host="%";
GRANT Grant Option ON *.* TO `root`@`%`;