Database Connection error – MULTI-DB

Hello

I have spent hours studying different topics in forum on multi-db. It has helped me to get as far successfully(I think) configuring db-config and moving blogs yeah!!

Now I have at the last hurdle, to visit the site…

My page is loading with “database connection error”, I have searched for this topic/issue and tried everything that was mentioned but i dont know what I am missing…

db-config.php is as followings

add_db_server(‘global’, ‘dc1′, 1, 1,’localhost’,’localhost’, ‘xxx_wp1global’, ‘user’, ‘password’:wink:;

add_db_server(‘global’, ‘dc1′, 1, 1,’localhost’,’localhost’, ‘xxx_wp1global’, ‘user’, ‘password’:wink:;

….

wp-config.php

define(‘DB_NAME’, ‘xxx_wp1global’:wink:;

/** MySQL database username */

define(‘DB_USER’, ‘user’:wink:;

/** MySQL database password */

define(‘DB_PASSWORD’, ‘password’:wink:;

/** MySQL hostname */

define(‘DB_HOST’, ‘localhost’:wink:;

I am on a reseller cpanel account. site worked fine before installing multi-db and the db username and password worked fine when I did move.

I need your assistance

Thanks

  • Barry
    • DEV MAN’s Mascot

    Just as a side note – if you are getting a “database connection error” in large text on your browser, it is generally a wp-config.php config problem, if you get the message that wp can’t find the tables for a blog, or that your blog doesn’t seem to be set up correctly, then it’s a db-config.php issue.

  • archomole
    • Design Lord, Child of Thor

    Thank you for your quick response! The message I get is “Error establishing a database connection” in bold. I have tried to copy paste username and database directly from cpanel and also reset password in cpanel. I am using the global database connection details. And I have only one user for all the databases, what was strange is the move-blog used the same credentails and it worked.

    is there a tool that I can use just to test database connection separately?

    I want to use that to determine if I am having issues with the database hosting.

    I cant wait to launch…

    Thanks a million

  • archomole
    • Design Lord, Child of Thor

    Yes I use the full database name in cpanel. I can access the databases via phpMyadmin. I tried removing user from db and then re-adding it. This beats me I have worked on multiple database applications so I am familiar with db connections. I cant seem to figure out what the issue is….

  • Barry
    • DEV MAN’s Mascot

    and it’s definitely put the databases on localhost? (sorry, running out of questions to ask to try to get to the bottom of this).

    Are you running a PC or Mac (just as an aside), can you switch on remote access to the db (in phpmyadmin) for your IP address and then connect with a db tool from your desktop (just to move away from a server connection to a remote one, we can test the db connection separately).

    I use Sequel Pro for Mac, I’m sure there will be one or two free mysql db tools for windows that are also free, or have a free trial.

  • archomole
    • Design Lord, Child of Thor

    Well I am not sure what is wrong. I download Toad for MySQl and use the connection details and I was able to remotely connect to all the databases. ( because I have one user for all the DBs)

    I am getting to a deadend…I need help please

  • Barry
    • DEV MAN’s Mascot

    Sorry, I popped out and missed a few of your posts. Glad it’s up and running, strange about the corrupt tables. Clicking repair in phpmyadmin is usually fine and can recover things with no data loss (at least I’ve never had it lose something – or at least haven’t noticed it do so).

    Global tables are those without a blog identifier in the name, so:

    wp_users is global wheras wp_2_posts is specific to the blog with the id of 2.

    Now, most of the default global tables (e.g. users above) the plugin already knows about, so you can ignore those. Any tables a plugin has added without a number in the table name needs to be added to the list.

    But, generally, if you are using the latest version of the multi-db plugin, then as long as everything (except your blogs tables – those with numbers) is in the global database you identified in your db-config file, then the multi-db system should find them (the fallback, if it hasn’t been told where a table is and its not a blog table is to look in the global database).

  • archomole
    • Design Lord, Child of Thor

    Thank you so much for your assistance. I decided not to install any additional plugin or buddypress before the multi-db installation. not sure if that had anything to do with it.

    Everything worked great…how do I check to make sure that multi-db is been used?

    or may be I will just try to add a new blog and see where it creates its database.

    adding new premium wpmu plugins will require adding the new tables first (sql.txt) right?

    Again thanks…