【发布时间】:2019-11-22 19:15:13
【问题描述】:
当我尝试在 mySQL 上为用户授予权限时,发生了错误。我在命令行上输入了什么错误吗?
mySQL Ver 8.0.16 for macos10.14 on x86_64 (MySQL Community Server - GPL)。
mysql>grant all privileges on librarydb.* to 'phill'@'%' identified by '123456';
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 '123456'' at line 1.
【问题讨论】:
-
只尝试这么多
grant all privileges on librarydb.* to 'phill'@'%'; -
identified by子句用于在创建用户期间定义密码。正如@SumitBadaya 建议的那样摆脱它。 -
@SumitBadaya 哇,它有效!非常感谢!但是为什么在这种情况下我不需要通过密码来识别呢?
-
@BarbarosÖzhan 我知道了,谢谢你的帮助!
-
alter user librarydb 标识为 '123456' 以更改密码。
标签: mysql privileges