The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

[resolved] "Error establishing a database connection" after changing DOMAIN_CURRENT_SITE (3 posts)

  1. Aren Cambre
    Posted 4 years ago #

    I have a WordPress Network at, say, x.company.com. That's also the value for DOMAIN_CURRENT_SITE in wp-config.php.

    This Network is on a Red Hat Enterprise Linux 6 system. It's under our control, in our data center. This server has had another WordPress Network running for over a year.

    We need to switch to y.company.com before this newer Network goes live. We don't have the DNS set up yet, so I altered the hosts file on my local PC to add y.company.com, plus I adjusted DOMAIN_CURRENT_SITE in wp-config.php to be y.company.com.

    Strangely, when I go to y.company.com, I get this error: Error establishing database connection. If I switch DOMAIN_CURRENT_SITE back to x.company.com, the site resumes working fine, and visits to y.company.com are redirected to x.company.com (which shows my hosts file is correctly set up).

    This baffles me because I've not changed the database settings, nor have I changed anything with the server's own network settings. What am I doing wrong with this install?

  2. Moving Multisite is a pill.

    You can't just move it, you have to edit the DB otherwise it literally looks for y.company.com in your DB and treats THAT as a DB error :/

    Read codex.wordpress.org/Moving_WordPress#Moving_WordPress_Multisite

  3. Aren Cambre
    Posted 4 years ago #

    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic