• My blog at https://www.coderanger.com/blog/ was working perfectly well. But now I am getting an error page “Error establishing a database connection”.

    My mySQL server database is still alive, the user name and password still exist. If I go onto the server that hosts the site and telnet to the database IP and port number it gets in fine …. so what else could be causing the problem?

    Please help.

Viewing 1 replies (of 1 total)
  • Thread Starter coderanger

    (@coderanger)

    It would actually have been useful if it gave the mysql error as once I created a test page it was clear what the problem was. Apparently there were not enough connections left … this seems odd, does WordPress not clean up properly possibly??

    Anyway, for others, I just created a test page with the following code to make it easy to test for problems in the future:


    <?php

    $connection = mysql_connect("serverip", "user", "pass")
    or die("Connection failed because: " . mysql_error());
    print ("Connection succeeded");
    mysql_close($connection);
    ?>

Viewing 1 replies (of 1 total)
  • The topic ‘Was working now getting “Error establishing a database connection”’ is closed to new replies.