MySQL does not allow remote clients to connect to the MySQL database, by default, and you may face the following error:
Host is not allowed to connect to this MySQL server
You can allow a specific client IP Address (e.g. 192.168.1.3) to access the MySQL database running on a server or any other machine. Following command is required to run on the computer running the MySQL database.
GRANT ALL ON . to root@'192.168.1.3' IDENTIFIED BY password;
where:
root, is the MySql user name to whom want to allow
password, is the password of that user to allow
Use % instead of IP (e.g. '192.168.1.3') to allow all IPs to connect with the given user
also, execute the following command (recommended but not required) in order to improve performance:
FLUSH PRIVILEGES;
If still facing some issue, you need to check your firewall, make sure that the port of MySQL, update firewall rules to make sure port 3306 (or whatever the port you gave to MySQL at the time of installation) incoming is open on the server that is running the MySQL database and outgoing open on the client machine where from accessing the server.
Posted Article in Programming