WordPress.org

Ready to get started?Download WordPress

Forums

Error establishing a database connection - but database is fine (3 posts)

  1. agerson
    Member
    Posted 2 years ago #

    I get the "Error establishing a database connection" however, this works just fine:

    <?php
    $db = @mysql_connect('localhost', 'wordpress_cgps', '****');
    if (!$db) echo "connection failed";
    else echo "connection succeeded";
    ?>
  2. agerson
    Member
    Posted 2 years ago #

    Never mind, it turned out to be a MYSQL privilege issue. Setting define('WP_DEBUG', true); in wp-config.php was helpful

  3. TCBarrett
    Member
    Posted 2 years ago #

    Have you looked at using http://codex.wordpress.org/Class_Reference/wpdb ?

    Don't forget to mark the topic solved, if it has been.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.