相关疑难解决方法(0)

MySQL错误:用户'a'@'localhost'的访问被拒绝(使用密码:是)

我使用 root 帐户创建的帐户'a'@'%'。但是我在指定host参数时无法使用该帐户连接到MySQL服务器。我可以不带-h参数成功连接。请看下面的文字记录。我希望有人能帮我解释一下。谢谢。

mysql> grant all on *.* to 'a'@'%' identified by a;
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 'a' at line 1
mysql> grant all on *.* to 'a'@'%' identified by 'a';
Query OK, 0 rows affected (0.00 sec)

mysql> show grants for 'a'@'%';
+-----------------------------------------------------------------------------------------------------------+
| Grants for a@%                                                                                            |
+-----------------------------------------------------------------------------------------------------------+
| GRANT …
Run Code Online (Sandbox Code Playgroud)

mysql authentication

23
推荐指数
2
解决办法
18万
查看次数

标签 统计

authentication ×1

mysql ×1