Environment: mysql5.7.11 + windows10 64-bit
Problem: When using mysql remote login command mysql — uroot — h192.168.1.102-p, ERROR mysql ERROR 1130 (HY000): Host ‘XXXX’ is not allowed to connect to this mysql server
The reason for the problem: For security reasons, the mysql server allows only local login to the database server by default.
Fix the problem: After you log in to mysql, change the “host” TAB in the “User” table in the “mysql” database, change the name from “localhost” to “%”, and restart mysql so that all remote machines can access it.
step 1: modify the mysql table
mysql -u root -pvmware
mysql> use mysql;
mysql> update user set host = ‘%’ where user = ‘root’;
mysql> flush privileges;
mysql> select host, user from user;
mysql> quit
Step 2: Restart mysql
Method 1: Find “View Local Services” in Windows Settings, find mysql service, and restart mysql service
![]()


![]()
Method 2:
Win 7 or XP will start and stop mysql directly from the CMD command line by calling NET stop mysql /net Start mysql.
win8 and above versions need to use administrator privileges to use the CMD command to start the service. The author USES windows10, so you need to find CMD. Exe, right click and select “run as administrator”, and then enter net stop mysql /net start mysql to start and stop the service.
![]()

Step 3: Use the remote login command again and the login is successful.
![]()
Problem: When using mysql remote login command mysql — uroot — h192.168.1.102-p, ERROR mysql ERROR 1130 (HY000): Host ‘XXXX’ is not allowed to connect to this mysql server
The reason for the problem: For security reasons, the mysql server allows only local login to the database server by default.
Fix the problem: After you log in to mysql, change the “host” TAB in the “User” table in the “mysql” database, change the name from “localhost” to “%”, and restart mysql so that all remote machines can access it.
step 1: modify the mysql table
mysql -u root -pvmware
mysql> use mysql;
mysql> update user set host = ‘%’ where user = ‘root’;
mysql> flush privileges;
mysql> select host, user from user;
mysql> quit
Step 2: Restart mysql
Method 1: Find “View Local Services” in Windows Settings, find mysql service, and restart mysql service


Method 2:
Win 7 or XP will start and stop mysql directly from the CMD command line by calling NET stop mysql /net Start mysql.
win8 and above versions need to use administrator privileges to use the CMD command to start the service. The author USES windows10, so you need to find CMD. Exe, right click and select “run as administrator”, and then enter net stop mysql /net start mysql to start and stop the service.

Step 3: Use the remote login command again and the login is successful.

Read More:
- Remote connection to MySQL database error: is not allowed to connect to this MYSQL server solution
- After installing mysql5.7 on centos7, an error 1045 (28000) is reported: access denied for user ‘root’ @’localhost ‘(using PAS)
- MAC MYSQL Start Error: The server quit without updating PID
- MYSQL Error 1045 (28000): access denied for user ‘root’ @’localhost ‘(using password: Yes)
- [Solved] Error: ER_HOST_NOT_PRIVILEGED: Host ‘x.x.x.x‘ is not allowed to connect to this MySQL server
- [Solved] there are special symbols in the initial password for installing MySQL in Hadoop, and an error is reported
- Mysql 8.0.13 Enabling remote access (ERROR 1064 (42000): You have an error in your SQL syntax; check the manual th)
- host ‘‘ is not allowed to connect to this mysql server Connect MYSQL Error
- [Solved]Error 1054 (42s22): unknown column ‘password’ in ‘field list’ how to modify the password
- [Solved] There is a problem with mysql8.0 without password in Navicat connection
- Docker mysql8 modify password
- Docker: How to Solve MYSQL8 & Navicat remote connection error
- [Solved] mysql 2003 remote access failed mysql8 configure remote access
- [Solved] Access denied for user ‘root‘@‘localhost‘ (using password: YES)
- [Solved] Error 1044: Access denied for user ‘syz-remote‘@‘%‘ to database ‘webapp‘
- MySQL Install Error: MySQL error 1042: Unable to connect to any of the specified MySQL hosts
- ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’
- Mysql ERROR 1067: Invalid default value for ‘date’ [How to Solve]
- [Solved] ERROR 2002 (HY000): Can’t connect to local MySQL server through socket’/var/lib/mysql/mysql.sock’ (2)
- Ubuntu ERROR 2003 (HY000): Can’t connect to MySQL server on ‘127.0.0.1’ (111)