[SOLVED] ERROR mysqli_real_connect(): (HY000/2002): No such file or directory

If you are getting a wordpress error that starts with “mysqli_real_connect(): (HY000/2002):” and includes “No such file or directory” and ends with “wp-includes/wp-db.php on line 1490”, then here is what resolved the issue for me.

In the wp-config.php file, include (or change) this line from

define(‘DB_HOST’, ‘localhost’);


define(‘DB_HOST’, ‘’);

I put it near the top. Hopefully this will help someone.

leave a comment : )

Join the Conversation

1 Comment

Leave a comment

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