![](/img/trans.png)
[英]host 'localhost' is not allowed to connect to this MySQL server (#1130)
[英]#1130 - Host ‘localhost’ is not allowed to connect to this MySQL server
我发出了以下命令:
DROP USER 'root'@'localhost'; GRANT ALL PRIVILEGES ON . TO 'root'@'%';
...在 PHPMyAdmin 中。 执行后,我立即被强制退出 PhpMyAdmin。 我有:
错误
#1130 - 不允许主机 'localhost' 连接到这个 MySQL 服务器,
如何解决我的问题?
改用 IP:
DROP USER 'root'@'127.0.0.1'; GRANT ALL PRIVILEGES ON . TO 'root'@'%';
有关更多可能性,请参阅此链接。
要创建 root 用户,看到 MySQL 是本地的,请从命令行执行以下命令(开始 > 运行 > "cmd" 不带引号):
mysqladmin -u root password 'mynewpassword'
在 phpMyAdmin 目录下找到文件“config.inc.php”并编辑以下几行:
$cfg['Servers'][$i]['auth_type'] = 'config'; // config, http, cookie
$cfg['Servers'][$i]['user'] = 'root'; // MySQL user
$cfg['Servers'][$i]['password'] = 'TYPE_YOUR_PASSWORD_HERE'; // MySQL password
请注意,'password' 字段中使用的密码必须与 MySQL 根密码相同。 此外,您应该检查此行中是否允许 root 登录:
$cfg['Servers'][$i]['AllowRoot'] = TRUE; // true = allow root login
这样你就设置了 root 密码。
在你的my.ini
下使用这个
[mysqldump]
user=root
password=anything
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.