I have a server trying to connect to a MySQL database hosted outside the local network. I am trying to use a public IP address to connect to it.
Testing the connection on the command line gives me this error:
ERROR 2003 (HY000): Can't connect to MySQL server on '[ip_address]' (146)
PDO gives me the same error. In any case, the connection works fine locally and within the same network, which scares my mind.
The MySQL server has its own binding address, so it accepts remote connections. The MySQL server also has a user with privileges set. But in any case, it seems that I can’t even start the connection in the first place.
Is there a value of my.cnf that needs to be added so that MySQL accepts requests from outside the local network?
Thank.
source
share