ERROR 1130 (HY000): Host ‘123.32.23.12’ is not allowed to connect to this MySQL server

RMAG news

My Problem

I want to connect to mysql server using my personal computer but I have this error.

ERROR 1130 (HY000): Host ‘123.32.23.12’ is not allowed to connect to this MySQL server

My Solution

Make sure your IP have access to database server

SELECT host FROM mysql.user WHERE User = ‘root’;

If you only see results with localhost and 127.0.0.1, you cannot connect from an external source. If you see other IP addresses, but not the one you’re connecting from – that’s also an indication.

You will need to add the IP address of each system that you want to grant access to, and then grant privileges:

CREATE USER ‘root’@‘ip_address’ IDENTIFIED BY ‘some_pass’;
GRANT ALL PRIVILEGES ON *.* TO ‘root’@‘ip_address’;

If you see %, well then, there’s another problem altogether as that is “any remote source”. If however you do want any/all systems to connect via root, use the % wildcard to grant access:

CREATE USER ‘root’@‘%’ IDENTIFIED BY ‘some_pass’;
GRANT ALL PRIVILEGES ON *.* TO ‘root’@‘%’;

Finally, reload the permissions, and you should be able to have remote access:

FLUSH PRIVILEGES;

Reference

https://stackoverflow.com/questions/19101243/error-1130-hy000-host-is-not-allowed-to-connect-to-this-mysql-server

Leave a Reply

Your email address will not be published. Required fields are marked *