MySQL 5.7 版本授权语句:
GRANT SELECT, PROCESS, SUPER, REPLICATION CLIENT, RELOAD ON *.* TO 'exporter'@'%' IDENTIFIED BY 'exporterpw';
flush privileges;
执行得到报错:
[2022-08-09 09:18:07] [42000][1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED BY 'exporterpw'' at line 1
昨天将 mysql 版本从 5.7.34 升级到了 8.0.3 ,应该是由于版本升级导致。
mysql 8.0 授权的语句:
create user 'exporter'@'%' identified by 'exporterpw' ;
grant SELECT, PROCESS, SUPER, REPLICATION CLIENT, RELOAD on *.* to 'exporter'@'%' with grant option ;
flush privileges;