mysql> GRANT ALL PRIVILEGES ON *.* TO yunqu@'%' WITH GRANT OPTION IDENTIFIED BY 'p@sswr0d123'; 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 'p@sswr0d123'' at line 1
时间: 2023-07-09 15:40:59 浏览: 134
MySQL:grant_语法详解(MySQL_5.X)
这个错误的原因是语法错误,正确的语法应该是在GRANT ALL PRIVILEGES ON *.* TO yunqu@'%'后面加上一个关键字IDENTIFIED BY 'p@sswr0d123',而不是在后面另起一行。正确的语法应该是:
```mysql
GRANT ALL PRIVILEGES ON *.* TO yunqu@'%' IDENTIFIED BY 'p@sswr0d123' WITH GRANT OPTION;
```
这样就可以成功授权了。
阅读全文