【发布时间】:2012-11-07 13:31:52
【问题描述】:
我在我的 Mac 上安装了 MySQL(使用 MAMP 安装程序),但遇到了问题。当我以这种方式创建具有“@%”主机名的用户时:
CREATE USER 'test'@'%' IDENTIFIED BY 'test';
我尝试通过 CLI 连接:mysql -u test -ptest,我收到此错误:
ERROR 1045 (28000): Access denied for user 'test'@'localhost'(使用 密码:是)
但是当我将主机名更改为 localhost 时:
RENAME USER 'test'@'%' TO 'test'@'localhost';
它有效。
知道如何让 MySQL 使用通配符吗?
谢谢。
【问题讨论】:
-
stackoverflow.com/questions/10299148/… 的可能重复项。请在此处查看我的答案:stackoverflow.com/questions/10299148/…