mysql通过root账号登录,新建账户并授予权限会报错:
mysql> GRANT SELECT ON *.* TO 'select_user'@'%';
ERROR 1045 (28000): Access denied for user 'root'@'%' (using password: YES)
解决方案:
mysql> update mysql.user set Grant_priv='Y' where user = 'root' and host = '%';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
然后退出登录,重启mysql服务,之后就能正常授权了。
Reference
-------他日江湖相逢 再当杯酒言欢-------