Installation of Magento 2 – Step 2: Add a Database – SQLSTATE[HY000] [2002] Connection Timeout

In the second step of the Magento 2 installation, despite correct login data  database connection fails. After you click on Next nothing happens at all, no loading animation, nothing. But if you wait for 30 seconds (depends on configuration) the error message will appear.

English Version:

SQLSTATE[HY000] [2002] Can't connect to MySQL server on 'localhost' (10060 "Unknown error")

German Version:

SQLSTATE[HY000] [2002] Ein Verbindungsversuch ist fehlgeschlagen, da die Gegenstelle nach einer bestimmten Zeitspanne nicht richtig reagiert hat, oder die hergestellte Verbindung war fehlerhaft, da der verbundene Host nicht reagiert hat.

If you try to connect using the command line client provided with XAMPP, you may experience the same issue:

In addition to that, mysql client does not exit after output, and you cannot kill the process with CTRL+C.

  • Running mysqld as service,
  • Running mysqld as administrator,
  • Running mysql as administrator,
  • Connecting with -h parameter: mysql -uroot -h

If nothing from the list above helps, check if there is any firewall blocking the mysqld (MySQL-Server). Remove all mysqld entries from the list of known programms and restart MySQL-Server.

Similar Topics:

Leave a Reply

Your email address will not be published. Required fields are marked *