MySQL 版本:'for the right syntax to use near 'identified by 'password' with grant option'

原创
2022/08/09 09:31
阅读数 332

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;
展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
0 评论
0 收藏
0
分享
返回顶部
顶部