I have a small database on a server in my LAN that I try to access remotely via ODBC.
Currently, I am making a program in Visual Basic to access, retrieve and display data from the server to an Excel file.
Sometimes, the program will stop working all of a sudden and display an error message:
[MySQL][ODBC 8.0(w) Driver]Can't connect to MySQL server on '{the IP address of the server with the correct port}'(10060)
My troubleshooting efforts so far:
- Tried to connect with the ODBC connector remotely: Failed
- Tried to connect with MySQL Workbench and access the Database remotely: Failed
- Tried to connect to the Database locally with HeidiSQL: Can connect without a problem
- Tried to connect to the Database locally with MySQL workbench: Can connect without a problem
With HeidiSQL, went to Host -> Status and checked the "Connections" value : Increase at every connection attempt. Checked the Connection_errors_xxx fields : all are 0 and never change.
I don't think the problem is the connection string as the program worked well before and nothing changed since. My guess is that either a firewall or the database itself is blocking incoming connections from my computer for some reason.
I tried to search if there was a way of having details on incoming connection requests (like in a Log file) but couldn't find anything.
The only way I found to "resolve" the problem is to wait some time (maybe a couple of hours) and then try to connect again.
Would anyone have an idea of where I could find the reason or some explanation on why this problem is happening and how to fix it?