mysqlphpmyadminwamp

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


I know this type of question has been asked lots of times, but none answer my problem. Please read carefully.

I was running my website on localhost using Wamp server normally. When today i decided to run an Acunetix scan for vulnerabilities on my localhost server.

Acunetix sent tons of commands to the mysql table in short period of time ( since it's localhost the commands went fast ) which cause my mysql server to crash with the error:

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

What I've already tried:

Running mysql through mysqld --skip-grant-tables I had access to mysql while on that, so I tried running

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

But I got the 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 I do am a mysql noob but I did my homeworks and searched google, but was unable to find the solution.

Any help ?

I managed ti fix the issue by reinstalling wamp server and fully uninstalling, even with the mysql.


Solution

  • When your server is running with --skip-grant-tables, you disable all MySQL security so you're not allowed 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 the user table.