Problem:
when using Navicat premium to remotely connect to MySQL via IP, it fails, indicating “is not allowed to connect to this MySQL server”, but it is normal to use localhost instead of IP locally.
*Operate on the server side
Solution:
modify the user table in the MySQL library, change the host value corresponding to the user root from localhost to%, and restart the MySQL service to take effect.
Method 1 (simplest): use Navicat premium local login to modify.
You can log in successfully with localhost locally. Open the user table in the MySQL library, change the host of the corresponding root user to%, submit and restart the MySQL service.
Method 2: login and modify with MySQL command line.
1. Connect to server: MySQL – U root – P
2. View all current databases: show databases( Note the comma at the end)
3. Enter MySQL database: use MySQL;
4. View all the tables in MySQL database: show tables;
5. View the data in the user table:
select Host, User,Password from user;
6. Modify the host in the user table.
update user set Host=’%’ where User=‘root’;
7. Refresh: flush privileges;
8. The test connection is successful
Link to the original text: https://blog.csdn.net/quan278905570/article/details/106327719
Read More:
- Host is not allowed to connect to this MySQL server
- MySQL local connection Error 1130_ The solution of MySQL 1130 error report when remote connection through Navicat for MySQL
- Sqlog connect to MySQL 8.0.24 remote server, error: 2058 solution
- MYSQL login error: mysqladmin: connect to server at’localhost’ failed
- PHP connection to MySQL database error: call to undefined function MySQL_ connect()
- Remote connection MySQL error 1045 solution
- The MySQL service suddenly hangs up with the error message can’t connect to MySQL server on ‘localhost’ (10061)
- It can’t connect to local MySQL server through socket ‘/ tmp/ mysql.sock ‘(2) “;
- node.js Server MySQL database connection timeout (error: connect etimeout)
- ERROR 1148 (42000): The used command is not allowed with this MySQL version
- MySQL Workbench Failed to Connect to MySQL at 127.0.0.1:3306 with user root Bad handshake
- MySQL Workbench: Error Code: 2013. Lost connection to MySQL server during query solution
- When MySQL is running, the server suddenly goes down, which causes Mysql to be unable to restart
- Navicat for MySQL error 1251 failed to connect to MySQL
- Error (1820) if the password is not changed in time after MySQL installation
- The server just without updating PID file and can’t connect to local MySQL server through socket are solved
- Can’t connect to MySQL server error 111
- Cannot connect to MySQL server on “host” (113)
- mysql problem solving: mysqladmin: connect to server at’localhost’ failed
- ERROR 2002 (HY000): Can’t connect to MySQL server on ‘localhost’ (10061)