Weird database error when multisite is activated in wp-config

Hi All - any help you can give me would be much appreciated.

I developed an MU site using the ip address of the hosting and the entire site went up fine with absolutely no issues at all.

But then after I switched the nameservers over for their domain and changed the wp-config file to the new domain address - I now get error connecting to database issues everytime I try to bring it up.

Deactivating the multisite portion of the wp-config fixes the connection error I get but then I don't have any of the other sites obviously and a bunch of MU only plugins don't work.

This has been driving me to the deepend and I have no idea what could be wrong with it.

This was my wp-config before the switch (db info has been changed for security):

define('DB_NAME', 'DB');

define('DB_USER', 'User');

define('DB_PASSWORD', 'Password');

define('DB_HOST', 'localhost');

define('DB_CHARSET', 'utf8');

define('DB_COLLATE', '');

define('AUTH_KEY',         'put your unique phrase here');
define('SECURE_AUTH_KEY',  'put your unique phrase here');
define('LOGGED_IN_KEY',    'put your unique phrase here');
define('NONCE_KEY',        'put your unique phrase here');
define('AUTH_SALT',        'put your unique phrase here');
define('SECURE_AUTH_SALT', 'put your unique phrase here');
define('LOGGED_IN_SALT',   'put your unique phrase here');
define('NONCE_SALT',       'put your unique phrase here');

$table_prefix  = 'wp_';

define ('WPLANG', '');

define('WP_DEBUG', false);

/* multi site config
define('WP_ALLOW_MULTISITE', true);

define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false );
$base = '/~mommycon/';
define( 'DOMAIN_CURRENT_SITE', '66.147.244.220' );
define( 'PATH_CURRENT_SITE', '/~mommycon/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );

if ( !defined('ABSPATH') )
	define('ABSPATH', dirname(__FILE__) . '/');

require_once(ABSPATH . 'wp-settings.php');

After the domain switch I only changed the following lines under the multisite portion

/* multi site config
define('WP_ALLOW_MULTISITE', true);

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

And nothing I have done seems to work - it's dirving me bananas!

Why would it work fine using the ip address and now won't work at all with the domain?

My host is Bluehost and when I talked to them they just said it was an issue with the wp-config and pointed me towards the Wordpress forums.

Any help you guys could give me would be much appreciated!

  • Gabrielle

    Hi Barry,

    Thanks! I already did a big search and replace throughout my db to ensure the transition went as smooth as possible - so I don't think that's the issue.

    But I don't actually have any wp_1_etc tables in there at all - just wp_xx and then the rest of the subsites have wp_2_xx and onwards.

    Do you think that could be the problem?

    It worked fine using just the IP so why the domain is not working is beyond me.

    Thanks!

  • Barry

    Do you think that could be the problem?

    No, with an install with just WP first you don't get the intitial wp_1 tables, they only start when you add blogs/sites.

    As a test, can you export all the tables for your database (use export in phpmyadmin if you have it) and do a search in a good text editor - you may have missed just one :slight_smile:

    Also, in your wp-config.php file, remove lines 7-10 (in your paste above) you don't need them and they just confuse things by stopping wp going through it's discovery process.

  • Gabrielle

    Ahhhh... silly me :wink:

    Just tried that with no luck - same error connecting.

    Changed the db to the one that I'm positive didn't miss any references to the IP address as well so that wasn't it.

    Could it be my .htaccess?

    Here's what's in it right now though I never actually touched it after the initial install:

    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).*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
  • Barry

    Nah - that looks ok (the htaccess) - it's usually the same in most installs - this is a strange one to be sure.

    Can you post up a list of tables you have in your database? The only thing i can think of now is that you may be missing some.

    also, if you have access to your php error logs, can you generate an error on the site (switch on your multi-site and get it to show the error message) and then check the error log and see what the last few lines are.

  • Gabrielle

    Sure thing!

    Here's th elong list of tables I've got in my db:
    wp_2_commentmeta
    wp_2_comments
    wp_2_contact_form_7
    wp_2_links
    wp_2_m_membership_news
    wp_2_ngg_album
    wp_2_ngg_gallery
    wp_2_ngg_pictures
    wp_2_options
    wp_2_postmeta
    wp_2_posts
    wp_2_terms
    wp_2_term_relationships
    wp_2_term_taxonomy
    wp_2_wp125_ads
    wp_14_commentmeta
    wp_14_comments
    wp_14_contact_form_7
    wp_14_links
    wp_14_ngg_album
    wp_14_ngg_gallery
    wp_14_ngg_pictures
    wp_14_options
    wp_14_postmeta
    wp_14_posts
    wp_14_terms
    wp_14_term_relationships
    wp_14_term_taxonomy
    wp_14_wp125_ads
    wp_15_commentmeta
    wp_15_comments
    wp_15_contact_form_7
    wp_15_links
    wp_15_ngg_album
    wp_15_ngg_gallery
    wp_15_ngg_pictures
    wp_15_options
    wp_15_postmeta
    wp_15_posts
    wp_15_terms
    wp_15_term_relationships
    wp_15_term_taxonomy
    wp_15_wp125_ads
    wp_16_commentmeta
    wp_16_comments
    wp_16_contact_form_7
    wp_16_links
    wp_16_ngg_album
    wp_16_ngg_gallery
    wp_16_ngg_pictures
    wp_16_options
    wp_16_postmeta
    wp_16_posts
    wp_16_terms
    wp_16_term_relationships
    wp_16_term_taxonomy
    wp_16_wp125_ads
    wp_17_commentmeta
    wp_17_comments
    wp_17_contact_form_7
    wp_17_links
    wp_17_ngg_album
    wp_17_ngg_gallery
    wp_17_ngg_pictures
    wp_17_options
    wp_17_postmeta
    wp_17_posts
    wp_17_terms
    wp_17_term_relationships
    wp_17_term_taxonomy
    wp_17_wp125_ads
    wp_18_commentmeta
    wp_18_comments
    wp_18_contact_form_7
    wp_18_links
    wp_18_ngg_album
    wp_18_ngg_gallery
    wp_18_ngg_pictures
    wp_18_options
    wp_18_postmeta
    wp_18_posts
    wp_18_terms
    wp_18_term_relationships
    wp_18_term_taxonomy
    wp_18_wp125_ads
    wp_19_commentmeta
    wp_19_comments
    wp_19_contact_form_7
    wp_19_links
    wp_19_ngg_album
    wp_19_ngg_gallery
    wp_19_ngg_pictures
    wp_19_options
    wp_19_postmeta
    wp_19_posts
    wp_19_terms
    wp_19_term_relationships
    wp_19_term_taxonomy
    wp_19_wp125_ads
    wp_20_commentmeta
    wp_20_comments
    wp_20_contact_form_7
    wp_20_links
    wp_20_ngg_album
    wp_20_ngg_gallery
    wp_20_ngg_pictures
    wp_20_options
    wp_20_postmeta
    wp_20_posts
    wp_20_terms
    wp_20_term_relationships
    wp_20_term_taxonomy
    wp_20_wp125_ads
    wp_21_commentmeta
    wp_21_comments
    wp_21_contact_form_7
    wp_21_links
    wp_21_ngg_album
    wp_21_ngg_gallery
    wp_21_ngg_pictures
    wp_21_options
    wp_21_postmeta
    wp_21_posts
    wp_21_terms
    wp_21_term_relationships
    wp_21_term_taxonomy
    wp_21_wp125_ads
    wp_22_commentmeta
    wp_22_comments
    wp_22_contact_form_7
    wp_22_links
    wp_22_ngg_album
    wp_22_ngg_gallery
    wp_22_ngg_pictures
    wp_22_options
    wp_22_postmeta
    wp_22_posts
    wp_22_terms
    wp_22_term_relationships
    wp_22_term_taxonomy
    wp_22_wp125_ads
    wp_23_commentmeta
    wp_23_comments
    wp_23_contact_form_7
    wp_23_links
    wp_23_ngg_album
    wp_23_ngg_gallery
    wp_23_ngg_pictures
    wp_23_options
    wp_23_postmeta
    wp_23_posts
    wp_23_terms
    wp_23_term_relationships
    wp_23_term_taxonomy
    wp_23_wp125_ads
    wp_24_commentmeta
    wp_24_comments
    wp_24_contact_form_7
    wp_24_links
    wp_24_ngg_album
    wp_24_ngg_gallery
    wp_24_ngg_pictures
    wp_24_options
    wp_24_postmeta
    wp_24_posts
    wp_24_terms
    wp_24_term_relationships
    wp_24_term_taxonomy
    wp_24_wp125_ads
    wp_25_commentmeta
    wp_25_comments
    wp_25_contact_form_7
    wp_25_links
    wp_25_ngg_album
    wp_25_ngg_gallery
    wp_25_ngg_pictures
    wp_25_options
    wp_25_postmeta
    wp_25_posts
    wp_25_terms
    wp_25_term_relationships
    wp_25_term_taxonomy
    wp_25_wp125_ads
    wp_26_commentmeta
    wp_26_comments
    wp_26_contact_form_7
    wp_26_links
    wp_26_ngg_album
    wp_26_ngg_gallery
    wp_26_ngg_pictures
    wp_26_options
    wp_26_postmeta
    wp_26_posts
    wp_26_terms
    wp_26_term_relationships
    wp_26_term_taxonomy
    wp_26_wp125_ads
    wp_blogs
    wp_blog_versions
    wp_commentmeta
    wp_comments
    wp_contact_form_7
    wp_links
    wp_memberships
    wp_memberships_deposits
    wp_messages
    wp_mp_products
    wp_mp_terms
    wp_mp_term_relationships
    wp_m_membership_levels
    wp_m_membership_news
    wp_m_membership_relationships
    wp_m_membership_rules
    wp_m_subscriptions
    wp_m_subscriptions_levels
    wp_m_subscription_transaction
    wp_newsletter
    wp_newsletter_profiles
    wp_ngg_album
    wp_ngg_gallery
    wp_ngg_pictures
    wp_options
    wp_postmeta
    wp_posts
    wp_registration_log
    wp_sent_messages
    wp_signups
    wp_site
    wp_sitemeta
    wp_terms
    wp_term_relationships
    wp_term_taxonomy
    wp_usermeta
    wp_users
    wp_wp125_ads

    As for error logs - there doesn't seem to be an php errors coming up. Last one on the log was for 4am this morning and was:

    [17-Mar-2011 04:54:02] PHP Warning: opendir(/home2/mommycon/public_html/wp-content/gallery/program-admin-files) [function.opendir]: failed to open dir: No such file or directory in /home2/mommycon/public_html/wp-content/plugins/list-yo-files/88-files.php on line 176

    There are a few general errors though:

    [Thu Mar 17 12:33:19 2011] [error] [client 66.147.244.220] File does not exist: /usr/local/apache/htdocs/wp-app.php
    [Thu Mar 17 12:33:25 2011] [error] [client 93.112.65.61] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://www.google.com
    [Thu Mar 17 12:33:25 2011] [error] [client 93.112.65.61] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://www.google.com
    [Thu Mar 17 12:33:45 2011] [warn] RewriteCond: NoCase option for non-regex pattern '-f' is not supported and will be ignored.

    See anything that might be the culprit? Once I get into server land I'm a bit useless so I have to give you a million thanks for all your help.

  • Aaron

    The host's file trick is change the dns for your test ip in your local hosts file, so that you can resolve your site in development like it's live.

    As far as your issue, i'm stumped. My only ideas are still a plugin like multidb replacing your db class, or records in your db that did not get replaced correctly.

    You may want to start tracing your code in the wpdb class to see what's actually happening at the connection point.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.