• I have an existing blog that I am now creating a network. I installed the network, but when I try adding the code it provides to the wp-config.php I get an “Error establishing database connection”. I get this error even when going to the original blog pages.
    If I removed those lines from the wp-config then it works correctly again, so it would seem it is not an issue with the database settings.

    The lines that I am adding are
    define( ‘MULTISITE’, true );
    define( ‘SUBDOMAIN_INSTALL’, false );
    $base = ‘/’;
    define( ‘DOMAIN_CURRENT_SITE’, ‘www.MYSITE.com’ );
    define( ‘PATH_CURRENT_SITE’, ‘/’ );
    define( ‘SITE_ID_CURRENT_SITE’, 1 );
    define( ‘BLOG_ID_CURRENT_SITE’, 1 );

Viewing 12 replies - 1 through 12 (of 12 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Where are you putting that code?

    You’re whole section looks like this:

    /** MultiSite **/
    define('WP_ALLOW_MULTISITE', true);
    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', true );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'domain.com' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );

    Thread Starter devpaq

    (@devpaq)

    I am putting it right before the line
    /* That's all, stop editing! Happy blogging. */

    I have the same code as you posted (except subdomain_install is set to false). When I remove these lines from the config file my site seems fine. But when I add it I get the error connecting to database.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    You’re not deleting the define('WP_ALLOW_MULTISITE', true); line, right?

    And do you have full control of your database?

    Thread Starter devpaq

    (@devpaq)

    Correct. I have that line in there as well.

    What kind of control would I need fro the database? Does a network need more control than a regular WP install?

    Thanks for your help.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    it needs to be able to create tables, which normally it has. Basically you should have ‘full access.’

    However… Who’s your host?

    Thread Starter devpaq

    (@devpaq)

    My host is rackspace – cloud sites.

    I see the new tables were created automatically so can I assume I have the correct permissions?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Yep, permissions are good.

    It’s possible your host doesn’t permit MultiSite though. Check with them.

    Thread Starter devpaq

    (@devpaq)

    Thanks again for your help.

    I spoke with my hosting company. Their response was:
    “This seems like a configuration issue. It is defintely not a limitation in our environment. I help customers everyday using wordpress multisite.”

    Any other suggestions you can think of?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    *snort* Thanks, Rackspace. If they help customers ever day using MultiSite, they coulda been helpful.

    Okay. Put the MultiSite code further up, like just below your hashes and salts.

    Thread Starter devpaq

    (@devpaq)

    There isn’t much else on the config file between the salts and where it is.

    I was doing some process of illumination and here is what I found. The 2 lines of code that are causing the issue are (not surprisingly)

    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', false );

    If any of these 2 lines are there it will cause the database error. All of the other lines I can put in without any issue.

    If I switch the SUBDOMAIN INSTALL to true, I no longer get a database error but instead I get an indefinite loop.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    That’s …

    Okay, this is going to sound weird, but can you make a wp-content/blogs.dir folder and set it up with the same permissions you did for wp-content/uploads?

    Thread Starter devpaq

    (@devpaq)

    Yes the blogs.dir folder is created and I gave it 777 permission.

    I tried a few different approaches and one of the errors mentioned it can’t reach the database at https://www.mydomain.com. But my hosting company has the database setup that it can’t use localhost but needs and actual database location. Could that be the issue? (I am sure i am not the first one).

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Database connection error – only when I add new lines to wp-config file’ is closed to new replies.