mysql> GRANT ALL PRIVILEGES ON *.* TO zhangsan@'%' IDENTIFIED BY '123'; ERROR 1064 (42000): 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 '123'' at line 1
时间: 2023-07-09 19:40:59 浏览: 179
mysql错误信息
3星 · 编辑精心推荐
这个错误的原因是语法错误,正确的语法应该是在GRANT ALL PRIVILEGES ON *.* TO zhangsan@'%'后面加上WITH GRANT OPTION,并且在IDENTIFIED BY '123'前面加上一个关键字PASSWORD。正确的语法应该是:
```mysql
GRANT ALL PRIVILEGES ON *.* TO zhangsan@'%' WITH GRANT OPTION IDENTIFIED BY '123';
```
这样就可以成功授权了。
阅读全文