0

This is my code to connect on DataBase.

private MySqlConnection conn;
string connString = $"SERVER=12312321; PORT=3306; DATABASE=yyy; UID=yyy; PASSWORD=passs;";
conn = new MySqlConnection(connString);
conn.Open();
conn.Close();

Every two weeks I have a problem with our users from other countries. They cannot connect to database for 1-2 days, after that it works smoothly. Now problem raised again and I have used VPN, and using IP from my country works, and using IPs from Italy, Spain, Germany, US, etc got this error: Error: 0 : Unable to connect to any of the specified MySQL

Isaac Bennetch
  • 11,830
  • 2
  • 32
  • 43
Viorel
  • 39
  • 7
  • I think you haven't provided enough information for us to help you. Are you tunneling a direct MySQL connection (port 3306) through the VPN tunnel? We need more information about the VPN, what you've tried, and what other traffic still passes when this is not working. Aside from that, as you're written it now, it's about debugging your VPN connection which is not a good fit for Stack Overflow, which is about writing code. It's possible your question might be better suited on, for instance Server Fault, but even then I'm not sure. – Isaac Bennetch Apr 24 '20 at 13:38
  • What language is this? `MySqlConnection` seems like it might be .Net? – Isaac Bennetch Apr 24 '20 at 13:40
  • Does this answer your question? [How to connect to MySQL Database?](https://stackoverflow.com/questions/21618015/how-to-connect-to-mysql-database) – ashishmishra Apr 24 '20 at 13:42
  • @ashishmirshra I think that is quite unrelated since the poster stated that the connection works for two weeks at a time. – Isaac Bennetch Apr 24 '20 at 14:03
  • It was a hosting problem. Their firewall sometimes is blocking those IPs. They told me that it is about their security. – Viorel Apr 26 '20 at 11:07
  • Yes, the language is .Net – Viorel Apr 26 '20 at 11:07

0 Answers0