[resolved] Enabling Multisite Broke My Database Connection (2 posts)

  1. jOt Creative
    Posted 3 years ago #

    This is my second multisite installation, yet it didn't go as easily as the first, even though they're on the same VPS.

    I went through the steps to "Set Up a Network" and upon visiting my site again, it simply says Error establishing database connection.

    To be clear, the lines I added to my wp-config.php file are:

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

    This is my entire .htaccess file:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]

    In two locations in the wp_options table the domain is correctly set as http://www.vpeglobal.com and in one location in the wp_site table the domain is correctly set as www.vpeglobal.com.

    The database information in wp-config has not changed, and I know that the database is still at localhost with the same credentials.

    I'm guessing my mistake is somewhere in the DNS settings, but I'm not sure.

  2. jOt Creative
    Posted 3 years ago #

    What I failed to mention (in an attempt to simplify my problem) is that I initially had the multisite working just fine at, and what I was really doing was changing the domain of the multisite installation.

    As such, it turned out that after multisite is installed, the domain and directory structure are referenced several more times in the database, and all of these need to be changed too!

    Found my answer here: http://wordpress.org/support/topic/error-establishing-database-connection-whats-wrong?replies=8


Topic Closed

This topic has been closed to new replies.

About this Topic