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?

1 Answer 1


As you previously said,

  1. Check the firewall: Ensure that the firewall is not blocking incoming connections to the database. You can check the firewall settings on both the client and the server.
  2. Verify that the server is configured to allow remote connections and that the correct port is open. You can also try increasing the max_connections value in the MySQL configuration file if it is set too low.

These are what i am thinking of, right now.

  • Thank you very much for your insights. 1. The firewall seem to work normally and not block any connection on either the client or the server. 2. The server configuration seem fine to me since the connection is done properly almost all the time. Same for the ports. I am the only one connected to this database and I coded the program to keep the connection alive instead of creating a new one all the time, so I don't think increasing the max_connections value would be of any help. Is there any way to get precise information regarding entering connections in a Log file ?
    – SuperRamen
    Commented Feb 10, 2023 at 0:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.