# 1130 - Host 'localhost' is not allowed to connect to this MySQL server - after running Acunetix scan

I know this question has been asked many times, but no one answered my problem. Please read carefully.

I launched my site on a local hosting using a Wamp server. When I decided today to run an Acunetix check for vulnerabilities on my localhost server.

Acunetix sent a ton of commands to the mysql table in a short period of time (since it ran commands quickly), which is why my mysql server crashes with an error:

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

What I already tried:

Starting mysql through mysqld --skip-grant-tables I had access to mysql during this, so I tried to start

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

But I got an error:

 mysql> DROP USER 'root'@'127.0.0.1'; GRANT ALL PRIVILEGES ON . TO 'root'@'%'; ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables opt ion so it cannot execute this statement 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 'TO 'r oot'@'%'' at line 1 

I admit that I am mysql noob, but I did my homework and searched google but couldn't find a solution.

Any help?

I was able to fix the problem by reinstalling the Wamp server and completely removing it even with mysql.

+7
mysql phpmyadmin wamp
source share
3 answers

When your server is running -skip-grant-tables, you disable all MySQL security so that you are not allowed to use GRANT commands. What you can do is access the mysql database and directly select and update the rows you need to change. In your case, it will be a user table.

+5
source share
  GRANT ALL PRIVILEGES ON *.* TO 'root'@'127.0.0.1'; 

http://dev.mysql.com/doc/refman/5.1/en/adding-users.html

EDIT.

because your mysql server is included in the read_only parameter. turn it off

connect to the server with the root user:

 mysql-h localhost-u root-p 

and run the command:

 mysql> set GLOBAL read_only = false; mysql> FLUSH TABLES WITH READ LOCK; mysql> UNLOCK TABLES; 

EDIT2;

you must stop the server and start this

mysqld_safe --skip-grant-tables due to root pwd chg

so stop the server and start it from the very beginning

+3
source share

I had the same problem.

You can add skip-grant-tables to my.ini for the [mysqld] tag in the # The MySQL server section and restart the mysql server.

Now you can open phpmyadmin and navigate to the user table in the mysql database. Verify that the password attribute is blank and that the host attribute is localhost. I encountered a second error. PHPMyAdmin tried to connect to the host value as "localhost", and the table contained the value 127.0.0.1.

Remove skip-grant-tables from my.ini and restart the MySQL server. That should work.

+1
source share

All Articles