Home >Database >Mysql Tutorial >How to Resolve MySQL Error 1130: Host 'xxx.xxx.xxx.xxx' is not allowed to connect to this MySQL server?
MySQL Connection Error 1130: Troubleshooting Remote Connections
The error message "ERROR 1130 (HY000): Host 'xxx.xxx.xxx.xxx' is not allowed to connect to this MySQL server" indicates that a host is attempting to connect to the MySQL server without proper permissions.
In this specific case, the root account has not been granted remote access. To resolve the issue, verify the user's host permissions with the query:
SELECT host FROM mysql.user WHERE User = 'root';
If the results only show 'localhost' and '127.0.0.1', the root account is restricted to local connections. To allow remote access, grant the user permission to specific IP addresses or use the '%' wildcard for any remote source:
CREATE USER 'root'@'ip_address' IDENTIFIED BY 'some_pass'; GRANT ALL PRIVILEGES ON *.* TO 'root'@'ip_address';
or
CREATE USER 'root'@'%' IDENTIFIED BY 'some_pass'; GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
Finally, reload the permissions:
FLUSH PRIVILEGES;
After these steps, the host should be able to establish a remote connection to the MySQL server.
The above is the detailed content of How to Resolve MySQL Error 1130: Host 'xxx.xxx.xxx.xxx' is not allowed to connect to this MySQL server?. For more information, please follow other related articles on the PHP Chinese website!