Forums

MU on localhost error connecting to DB message, but w/ DB connection? (3 posts)

  1. fhsm
    Member
    Posted 1 year ago #

    I'm trying to move a site to localhost for testing. I've got a working LAMP stack (wp installed previously w/o any problem).

    I've pulled down all the code for the site I'm trying to migrate and the database and changed the DB connection info in the wp-config.php file; however, I'm still getting "Error establishing database connection".

    The credentials are right. I can import wp-config and use the defined globals to establish my own DB connection. The DB has a MU and a single site install in it (different prefixes). If I comment out the MU part of wp-config and change the table prefix I can connect to the single site install w/o any problem.

    Now things get odd: if I switch my prefix to my mu prefix but leave

    define('WP_ALLOW_MULTISITE', true);
    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', false );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'localhost' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );

    commented out I get the my MU site up to the header but nothing more.

    Obviously I've done something wrong, but the error is also wrong b/c it's clearly getting a DB connection.

    Any ideas what this could be?

  2. jamesmehorter
    Member
    Posted 11 months ago #

    I'm having the exact same issue. fhsm did you ever find a fix for this?

  3. Andrea_r
    team pirate
    Posted 11 months ago #

    It means it can't find the site in the db.

Topic Closed

This topic has been closed to new replies.

About this Topic