MYSQL cannot connect from a remote solution of s not allowed to connect to this MySQL server

  • 2020-05-12 06:16:58
  • OfStack

If this error occurs when you want to connect to your mysql:
 
ERROR 1130: Host '192.168.1.3' is not allowed to connect to this MySQL server 

Solutions:

1. Change table method. It may be that your account is not allowed to log in remotely from localhost only. At this point, once you have logged in to mysql from the localhost computer, change the "host" entry in the "user" form of the "mysql" database from "localhost" to "%".
mysql -u root -pvmwaremysql > use mysql;mysql > update user set host = '%' where user = 'root';mysql > select host, user from user;

2. Authorization. For example, if you want myuser to connect to the mysql server from any host using mypassword.
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
If you want to allow user myuser to connect to the mysql server from ip's 192.168.1.3 host and use mypassword as the password
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY
'mypassword' WITH GRANT OPTION;

Related articles: