2

I'm using MySQL 5.7.40 on Ubuntu 18.04.6 LTS (GNU/Linux 4.15.0 x86_64)

I didn't make any changes since weeks.

My websites are on another server. So it's a remote connection.

Since some hours ago my website suddenly cannot access the MySQL server. I'm using PDO for that. Another website of mine which also has a remote access to MySQL is able to connect without any problem.

PDO error message is:

SQLSTATE[HY000] [2002] Connection timed out

Do you have any idea why? Is there something like a blacklist?

12
  • So the current DBs are running remotely? If so, can you connect the DB server with SSH?
    – Dream Bold
    Dec 12, 2022 at 16:50
  • @DreamBold Yes, the current DBs are running remotely. How can I connect the DB server with SSH?
    – David
    Dec 12, 2022 at 16:52
  • Out of curiosity; Is this all hosted by you on owned/physical servers in different locations, or some shared cloud-like service like Hostgator? I only ask, because I have some mysql dbs and apis setup with Hostgator and Heroku and have noticed the exact same issue, but it seems to resolve itself after some time and is intermittent. Very annoying. It also affects my automated backups (which I handle on my own from a home server). This only started about 1-2 months ago after years of having no issues.
    – chrisbyte
    Dec 12, 2022 at 16:52
  • What hosting providers do you use? @David
    – Dream Bold
    Dec 12, 2022 at 16:52
  • delta-networks.de for MySQL and contabo.com/de für web hosting.
    – David
    Dec 12, 2022 at 17:00

1 Answer 1

0

It is useful to identify whether all connectivity is toast, or just a specific Type-P connectivity.

Here's at least three types of connectivity worth trying:

  • TCP port 3306 (mysql)
  • TCP port 443 (https)
  • ICMP (ping)

If some but not all IP transport is usable, that suggests that core internet routers have a usable BGP4 route from here to there, and back. In which case it is likely the distant hosting ISP has blacklisted just mysql connections, perhaps to enforce some policy such as a rate limit.

If all IP transport is unusable, then the blockage could be anywhere, within the internet's core or at the distant hosting ISP. Add traceroute / mtr output to the question if there are details you want to discuss.


Running tests from more than one source IP network can shed additional light on the situation.

If you only have access to a very limited number of distinct locations, then a Looking Glass server can help.


Note the timestamp of each connectivity measurement. Conditions in the internet can change rapidly. Flapping BGP routes is one of several causes of intermittent connectivity issues.

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.