Test Server Connection

Error establishing a database connection is my least favourite error message. There’s so many things that you need to check, and the error itself (imo!), does not provide very much direction.

Fortunately, there are already lots of guides to help point you in the right direction. WP Beginner breaks down all of the items you should be checking out if you run into issues setting up / launching a site.

You can also use this handy function to test if the information you’ve entered into wp-config.php is accurate. It’s mentioned in the above article, and you can see more examples here.

<?php



// place me in a test.php file at the root!



$link = mysql_connect('localhost', 'root', 'password');



if (!$link) {



die('Could not connect: ' . mysql_error());



}



echo 'Connected successfully';



mysql_close($link);



?>

 

Leave a Reply

katherine as a flat graphic icon

About Me

I’m an African / Ojibwe First Nations Web Developer living in Winnipeg, Manitoba.

Visit the Tips and Blog to see what I’m working on.