MySQL Forums
Forum List  »  PHP

Random SQLSTATE[HY000] [2002] A connection attempt failed
Posted by: Bastiaan van Haastrecht
Date: June 29, 2020 01:28AM


We are experiencing random SQLSTATE[HY000] [2002] messages. A few times a day this message pops up in the PHP/Laravel logs. It's just a random query which then fails to communicate with the MySQL server.

The webserver is in a DMZ with the MySQL server in a seperate LAN protectted with a firewall in between. We see no issues in the firewall, no errors in the MySQL error log and no other signs on both boxes somethings wrong.

Web server:
Windows 2016
PHP 7.4.4
Laravel 8.0

Database server:
Windows 2019
MySQL 8.0.20

Error message:
SQLSTATE[HY000] [2002] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

What could be the cause of this message and how can we possible solve this?

Kind regards,

Options: ReplyQuote

Written By
Random SQLSTATE[HY000] [2002] A connection attempt failed
June 29, 2020 01:28AM

Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.