WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Database connection fail (22 posts)

  1. Topher
    Member
    Posted 3 years ago #

    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?

  2. Tim Moore
    Moderator
    Posted 3 years ago #

    Did you change the database server address in wp-config.php?

  3. Topher
    Member
    Posted 3 years ago #

    Yes. :)

  4. Topher
    Member
    Posted 3 years ago #

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

  5. Topher
    Member
    Posted 3 years ago #

    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?

  6. Tim Moore
    Moderator
    Posted 3 years ago #

    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.

  7. Topher
    Member
    Posted 3 years ago #

    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.

  8. Topher
    Member
    Posted 3 years ago #

    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. :(

  9. 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?

  10. Topher
    Member
    Posted 3 years ago #

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

  11. Tim Moore
    Moderator
    Posted 3 years ago #

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

  12. Ron Rennick
    MultiSite Guru
    Posted 3 years ago #

    WordPress version?

  13. Topher
    Member
    Posted 3 years ago #

    We're running 3.1.

    We're using wp_ as the prefix.

  14. Ron Rennick
    MultiSite Guru
    Posted 3 years ago #

    Try changing

    define('VHOST', 'no');

    to

    define('SUBDOMAIN_INSTALL', false);

  15. Topher
    Member
    Posted 3 years ago #

    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.

  16. Ron Rennick
    MultiSite Guru
    Posted 3 years ago #

    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.

  17. Topher
    Member
    Posted 3 years ago #

    That appears to have no affect. :(

  18. Tim Moore
    Moderator
    Posted 3 years ago #

    I know this is a dumb question: you're data from your old database is in the new database, right? Because the effects you are describing sound like ones where you have transferred the actual files, but not the database content.

  19. Topher
    Member
    Posted 3 years ago #

    Yep, the content is all there.

  20. Ron Rennick
    MultiSite Guru
    Posted 3 years ago #

    This URL works for me: http://www.varsitynewsnetwork.com/

  21. Topher
    Member
    Posted 3 years ago #

    Yes, we did a clean install with the thought of perhaps starting over from scratch. My server really doesn't like what we brought from the old server.

    It's all in the wp-config file, all in the MU settings we had. I just can't figure out the combination that's killing it.

  22. Topher
    Member
    Posted 3 years ago #

    We figured out what was wrong. In our export from the old database it didn't get all the tables it needed. We have several hundred tables, and even though we told phpMyAdmin we wanted them all, it only gave use about 2/3 of of them. It did NOT error on the export, it simply said it had given them all to us. I suspect php timed out, but I then would have expected the export to be bad as well.

    In the end I did two exports, half in each one.

    I also don't understand why my wordpress error was a connection failure.

    But we're golden now. :)

    Thanks for the help everyone!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags