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:
- host ‘‘ is not allowed to connect to this mysql server Connect MYSQL Error
- Remote connection to MySQL database error: is not allowed to connect to this MYSQL server solution
- [Solved] Error: ER_HOST_NOT_PRIVILEGED: Host ‘x.x.x.x‘ is not allowed to connect to this MySQL server
- [Solved] ERROR 2002 (HY000): Can’t connect to local MySQL server through socket’/var/lib/mysql/mysql.sock’ (2)
- ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’
- MYSQL Enter password:ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost:3306‘
- Ubuntu ERROR 2003 (HY000): Can’t connect to MySQL server on ‘127.0.0.1’ (111)
- How to Solve can‘t connect to local mysql server through socket ‘/var/lib/mysql/mysql.sock‘
- MySql Install Error: Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘
- [Solved] MYSQL Command Execute Error: Can ‘t connect to local MySQL server through socket ‘/tmp/mysql.sock ‘(2) “
- ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’
- How to Solve MYSQL Error: Failed to start MySQL 8.0 database server
- MySQL Install Error: MySQL error 1042: Unable to connect to any of the specified MySQL hosts
- (Fixed) workbench MySQL Error Code: 2013. Lost connection to MySQL server during query
- MYSQL Insert Data Error: check the manual that corresponds to your MySQL server version for the right syntax
- How to Fix MySQL error 1005: can’t create table (errno: 150)
- Mysql Flashback Warning: C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql.exe
- MYSQL Slave is not configured or failed to initialize properly. You must at least set –server-id
- [Solved] CentOS installs MySQL and starts MySQL with error 2002 (HY000)
- [Solved] MYSQL Error: ERROR! MySQL server PID file could not be found!