# 1130 - The local Host is not allowed to connect to this MySQL server

I issued the command:

DROP USER 'root'@'localhost'; GRANT ALL PRIVILEGES ON . TO 'root'@'%'; 

... in PhpMyAdmin. Immediately after the execution, I was forced to leave PhpMyAdmin. I got:

Error

# 1130 - Host 'localhost' is not allowed to connect to this MySQL Server,

How to solve my problem?

+4
source share
3 answers

Use the IP address instead:

 DROP USER 'root'@'127.0.0.1'; GRANT ALL PRIVILEGES ON . TO 'root'@'%'; 

For more features, see this link .

To create a superuser, seeing how MySQL is local and everything, do the following from the command line (Start> Run> "cmd" without quotes):

 mysqladmin -u root password 'mynewpassword' 

Documentation and Lost root access in MySQL .

+7
source

Locate the "config.inc.php" file in your phpMyAdmin directory and edit the following lines:

$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

Please note that the password used in the password field must be the same for the MySQL user password. In addition, you should check if root is allowed on this line:

 $cfg['Servers'][$i]['AllowRoot'] = TRUE; // true = allow root login 

Thus, you have your root password set.

0
source

Use this in my.ini under

 [mysqldump] user=root password=anything 
-one
source

All Articles