Remote MySQL connection fails (10060) - "Can't connect to MySQL server on domainname.com(10060)" I have developed an application in VB6, and am using an online MySQL database server for storing my application's data.

The first time I try to connect to my database server is successful, but after closing my application and starting it again I get:


  Can't connect to MySQL server(10060)"


After some time (approximately 30 minutes), I can successfully connect to the database again.


I have given maximum values to all of MySQL system and global variables like connection_timeout, wait_timeout etc.
I have granted all permissions to my MySQL user.
The firewall on my computer is turned off.
All connections are properly closed when the application closes.


I have asked the technical people who provide the Online MySQL Database service and they gave me these three reasons:


The local machine from where you are trying to connect is not whitelisted on the server.
The maximum number of connections for the user has been exceeded.
The MySQL server was down at the time (though they said that their server was not down).


How can I solve the first two reasons, or determine that they are the cause of the problem? Or could there be another problem not listed there?
you need to make sure there is:

a user created that has remote access for example user@'x.x.x.x'

the two machines can establish a connection (they can ping each
other for example or access each another by another method) the port
is opened between the two machines

check your configuration file  my.ini/my.cnf for parameters like bind-address or skip-networking. Is there a blocking connection parameter
like:bind-address=a.a.a.a or skip-networking?

the service is up and running when you try to connect from the
other machine