mysql 授予权限而不用密码识别

mysql grant privileges without identified by password

当我运行:

mysql> grant all privileges on database.* to user@localhost;

它returns:

Query OK, 0 rows affected (0.00 sec)

它不应该给出一个错误,因为我没有包括 "identified by 'password'" 吗?

请说明,用户已有密码。

引用文档:

Without IDENTIFIED BY, the account password remains unchanged.

由于该帐户已经存在,并且有密码,并且您不想更改它,因此您确实应该指定一个identified by子句。