1130 - Host '113.246.250.221' is not allowed to connect to this MySQL server when Navicat connects to MySQL data

1130 - Host ‘113.246.250.221’ is not allowed to connect to this MySQL server

insert image description here

introduce:

When using Navicat to connect to the MySQL database, sometimes you may encounter an error message: "1130 - Host '113.246.250.221' is not allowed to connect to this MySQL server". This problem is usually caused by database settings that restrict access to specific hosts. This blog will describe the cause of this problem and provide a corresponding solution.

reason:

This error occurs because the MySQL database is configured with an access control list (ACL), which contains a list of hosts that are allowed to connect. If the host where Navicat is located ('113.246.250.221' in this example) is not in this list, then the connection request will be rejected, resulting in the above error.

solution:

To resolve this issue, you can take the following steps:

  1. Check the access control list (ACL) of the MySQL database:
    log in to the MySQL server, and execute the following command with administrator privileges to view the ACL list:
SELECT user, host FROM mysql.user;

This will display a list of users and hosts. Make sure the host where Navicat is located ('113.246.250.221') is in the list.

  1. Add missing host to ACL list:
    If the host where Navicat is located does not appear in the ACL list, you can use the following command to add it:
GRANT ALL PRIVILEGES ON *.* TO 'your_username'@'113.246.250.221' IDENTIFIED BY 'your_password' WITH GRANT OPTION;
# 刷新缓存
FLUSH PRIVILEGES;

Replace your_usernameand your_passwordwith your username and password. This will grant the host full access to the MySQL database.

  1. Check firewall settings:
    Make sure that the firewall settings between the host where the MySQL server is located and the host where Navicat is located allow database connections. If a firewall blocks connection requests from Navicat host, you need to adjust the firewall settings accordingly.

  2. Restart the MySQL service:
    After applying changes, it is sometimes necessary to restart the MySQL service for the changes to take effect. You can try to restart the MySQL server and try to connect with Navicat again.

Summarize:

You should be able to resolve the "1130 - Host '113.246.250.221' is not allowed to connect to this MySQL server" by checking the Access Control List (ACL) of the MySQL database, adding missing hosts to the ACL list, and making sure the firewall is set up correctly. Remember, before making any changes, always back up your database just in case.

Guess you like

Origin blog.csdn.net/weixin_45626288/article/details/131251563