Support » Networking WordPress » Database connection fail

  • Resolved Topher

    (@topher1kenobe)


    W’re moving our MU install from a Media Temple GS server to a DV server. We’ve moved the content, created the new database, and logged into the database from both phpMyAdmin and the command line. WordPress tells us “Error establishing database connection” though.

    I’ve checked spelling and code errors.

    I’ve made sure the database is accessable with that connect info.

    I’ve “repaired tables” in mysql.

    I’ve removed all plugins.

    What could make it not connect?

Viewing 15 replies - 1 through 15 (of 21 total)
  • Did you change the database server address in wp-config.php?

    Topher

    (@topher1kenobe)

    Yes. 🙂

    Topher

    (@topher1kenobe)

    Further information: we’re running another web app from the same database, and it can connect just fine.

    Topher

    (@topher1kenobe)

    Further information: a clean install works, so it’s something in my config file. Everything is spelled properly. Do I need to mess with making new auth_key and SECURE_AUTH_SALT etc?

    I’ve never had trouble moving a site like this before, but I’ve never moved an MU site before. Should it matter?

    No, the salts shouldn’t matter; they don’t effect connections to the database.

    Something is up with the values for DB_NAME, DB_HOST, DB_USER and DB_PASSWORD.

    I’ve moved MultiSite installs around before as you are doing and haven’t seen this problem. Not sure what is going on.

    Topher

    (@topher1kenobe)

    The clean install used the same values for DB_NAME, DB_HOST, DB_USER and DB_PASSWORD successfully, so it’s something else. Does any of this have any impact?

    /** The Database Collate type. Don't change this if in doubt. */
    define('DB_COLLATE', '');
    define('VHOST', 'no');
    $base = '/';
    define('DOMAIN_CURRENT_SITE', 'varsitynewsnetwork.com' );
    define('PATH_CURRENT_SITE', '/' );
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOGID_CURRENT_SITE', '1' );
    
    define('WP_MEMORY_LIMIT', '64M');
    
    putenv('TMPDIR=' . ini_get('upload_tmp_dir'));
    define('FS_CHMOD_DIR', (0755 & ~ umask()));
    define('FS_CHMOD_FILE', (0644 & ~ umask()));

    Commenting it out tells me there’s no site configured here, but no db error.

    Topher

    (@topher1kenobe)

    I’ve determined that it’s due to the fact it’s an MU install. The code in the above post is what’s killing the connection, and I’m really stuck. 🙁

    Andrea Rennick

    (@andrea_r)

    Customer Care at Copyblogger Media and Studiopress

    putenv(‘TMPDIR=’ . ini_get(‘upload_tmp_dir’));
    define(‘FS_CHMOD_DIR’, (0755 & ~ umask()));
    define(‘FS_CHMOD_FILE’, (0644 & ~ umask()));

    This is custom and not something I’m familiar with. (ie; it’s not wpmu specific)

    So yeah – it’s an upgraded mu install as opposed to multisite.

    define(‘DOMAIN_CURRENT_SITE’, ‘varsitynewsnetwork.com’ );
    define(‘PATH_CURRENT_SITE’, ‘/’ );
    define(‘SITE_ID_CURRENT_SITE’, 1);
    define(‘BLOGID_CURRENT_SITE’, ‘1’ );

    Just for giggles, comment out this block. what happens?

    Topher

    (@topher1kenobe)

    When I comment it out WordPress tells me that there is no site configured at this address.

    When you first installed WPMU, did you use a custom database prefix? Instead of “wp_”, something else?

    Ron Rennick

    (@wpmuguru)

    MultiSite Guru

    WordPress version?

    Topher

    (@topher1kenobe)

    We’re running 3.1.

    We’re using wp_ as the prefix.

    Ron Rennick

    (@wpmuguru)

    MultiSite Guru

    Try changing

    define('VHOST', 'no');

    to

    define('SUBDOMAIN_INSTALL', false);

    Topher

    (@topher1kenobe)

    That didn’t help. We’re using subdirectories and not subdomains, not sure if that makes a difference. This DID start off as an MU install.

    Commenting this: define(‘PATH_CURRENT_SITE’, ‘/’ ); is enough to make it say no site exists at this address.

    Ron Rennick

    (@wpmuguru)

    MultiSite Guru

    We’re using subdirectories and not subdomains, not sure if that makes a difference.

    SUBDOMAIN_INSTALL => false (ie. not a subdomain install)

    Try renaming or deleting both the wp-includes and wp-admin folders and upload a fresh copy of both.

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Database connection fail’ is closed to new replies.