首页 > 数据库 >MySQL8设置用户权限报错You have an error in your SQL syntax;right syntax to use near ‘IDENTIFIED BY

MySQL8设置用户权限报错You have an error in your SQL syntax;right syntax to use near ‘IDENTIFIED BY

时间:2023-03-18 15:37:41浏览次数:39  
标签:use right IDENTIFIED syntax 报错 权限 your

mysql 8 设置用户权限命令和之前不一样
之前:
grant all privileges on *.* to 'myuser'@'%' identified by 'mypassword' with grant option;

报错:

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 ‘123456’ WITH GRANT OPTION’ at line 1

现在:
CREATE USER 'myuser'@'%' IDENTIFIED BY '123456'; #创建用户
grant all privileges on *.* to 'myuser'@'%' ; #分配权限
FLUSH PRIVILEGES; #刷新权限

标签:use,right,IDENTIFIED,syntax,报错,权限,your
From: https://www.cnblogs.com/A121/p/17230854.html

相关文章