首页 > 解决方案 > MySQL授权语法错误

问题描述

您好我尝试运行此 SQL 查询:

grant all on `mch`.* to 'admin'@'localhost' 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

标签: mysqlsql

解决方案


根据您使用的版本,不再允许这样做。

从 MySQL 5.7.2 开始,如果帐户已经存在,则禁止使用 IDENTIFIED WITH,因为它仅用于创建新帐户时使用。


推荐阅读