ERROR 1290:...skip-grant-tables option so it cannot execute this statement
今天接手一台mysql,root@localhost账户进入,发现授权时报错如下:
ERROR1044(42000):Accessdeniedforuser'root'@'localhost'todatabase'yao'
最终发现该root在初始授权时没有加上withgrantoption
解决办法:
配置文件中增加skip-grant-tables
重启mysql后重新登录授权报错:
ERROR1290(HY000):TheMySQLserverisrunningwiththe--skip-grant-tablesoptionsoitcannotexecutethisstatement
这个错误执行flushprivileges后再次授权就可以了。