[英]#1130 - Host ‘localhost’ is not allowed to connect to this MySQL server
I issued a command of:我发出了以下命令:
DROP USER 'root'@'localhost'; GRANT ALL PRIVILEGES ON . TO 'root'@'%';
...in PhpMyAdmin. ...在 PHPMyAdmin 中。 Immediately after the execution, I was forced out PhpMyAdmin.
执行后,我立即被强制退出 PhpMyAdmin。 I got:
我有:
error错误
#1130 - Host 'localhost' is not allowed to connect to this MySQL server,
#1130 - 不允许主机 'localhost' 连接到这个 MySQL 服务器,
how to resolve my problem?如何解决我的问题?
Use the IP instead:改用 IP:
DROP USER 'root'@'127.0.0.1'; GRANT ALL PRIVILEGES ON . TO 'root'@'%';
For more possibilities, see this link .有关更多可能性,请参阅此链接。
To create the root user, seeing as MySQL is local & all, execute the following from the command line (Start > Run > "cmd" without quotes):要创建 root 用户,看到 MySQL 是本地的,请从命令行执行以下命令(开始 > 运行 > "cmd" 不带引号):
mysqladmin -u root password 'mynewpassword'
Documentation , and Lost root access in MySQL .文档和在 MySQL 中失去 root 访问权限。
Find the file "config.inc.php" under your phpMyAdmin directory and edit the following lines:在 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
Note that the password used in the 'password' field must be the same for the MySQL root password.请注意,'password' 字段中使用的密码必须与 MySQL 根密码相同。 Also, you should check if root login is allowed in this line:
此外,您应该检查此行中是否允许 root 登录:
$cfg['Servers'][$i]['AllowRoot'] = TRUE; // true = allow root login
This way you have your root password set.这样你就设置了 root 密码。
Use this in your my.ini
under在你的
my.ini
下使用这个
[mysqldump]
user=root
password=anything
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.