rootなのにgrantコマンドが実行できない…。
mysql> GRANT ALL PRIVILEGES ON *.* TO root@'%' with grant option; ERROR 1045 (28000): Access denied for user 'root'@'%' (using password: YES)
そんな時の対処法。
これだけなのにかなり悩んだのでメモ。
grant option権限復活
grant有効
とりあえずrootのみにしとく。
mysql> update mysql.user set Grant_priv='Y' where user='root';
設定反映
mysql> FLUSH PRIVILEGES;
権限確認
rootのGrant_privがYになってるか確認。
mysql> select user,Grant_priv from mysql.user;
権限確認
末尾にWITH GRANT OPTIONが付いてるか確認。
mysql> show grants;