WordPress cannot connect to MySQL on SQL303 – Connection timed out

Website URL

https://heatgo.great-site.net

Error Message

mysqli_real_connect(): (HY000/2002): Connection timed out

Error establishing a database connection.

The database has been successfully imported and phpMyAdmin can access the database, but WordPress/PHP cannot connect to the MySQL server.

MySQL host: sql303.infinityfree.com
Database: if0_43014825_heatgo
MySQL user: if0_43014825

Other Information

I migrated my WordPress website from LocalWP to InfinityFree.

The WordPress files have been uploaded to /htdocs and the database SQL file was successfully imported into the InfinityFree database. phpMyAdmin shows the WordPress tables.

I have also checked wp-config.php and confirmed the database name, username, password and hostname.

The PHP error specifically says: “Connection timed out”.

Please check whether there is an issue with PHP connections to the SQL303 MySQL server.

I checked your wp-config.php file and immediately spotted the issue. You’re using the value sql303_infinityfree.com as database hostname. That’s not right, it should be sql303.infinityfree.com.

I don’t see any other obvious issues, so please try updating that and see if it solves the issue.