WordPress.org

Ready to get started?Download WordPress

Forums

Was working now getting "Error establishing a database connection" (2 posts)

  1. coderanger
    Member
    Posted 8 years ago #

    My blog at http://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.

  2. coderanger
    Member
    Posted 8 years ago #

    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);
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic