Cannot get Multi-DB to connect

(I realise the plugin section is wrong but Multi-DB doesn't appear in the options dropdown!)

I'm going through pretty much the same grief as most users seem to with Multi-DB because the instructions for this are so ambiguous.

At present my move-blogs.php is throwing up:-

"Database Error: Access denied for user ''xxxxx'@'%' to database 'zzzzz_c'

(data obfuscated)

Well, user xxxxx'@'% doesn't exist so that's got me stumped! The stopping at database _c seems to correlate with a query in another Multi-DB thread by svteg.

I have an existing database with existing tables, and I've set up a blank _global one as well, but no dice. Do we use IPs or specific localhost:port addresses? Why a 3 block IP at add_dc_ip and not 4 (or is it 4 anyway - comments show 3, the instructions show 4). The comment in another thread:-

"Line 25: add_global_table('restrell');
Do you have a table in your global database called wp_restrell? If not then that line shouldn't be there."

Well, I thought the instruction was to add the table so it shouldn't be there anyway!

I'm really and truly lost. Can something please give a clear and unambiguous set of visual instructions for what should be a relatively simple setup. It's the only element of WPMU DEV that's truly been beyond me at present.

  • Dharmendra

    Hello @devex,

    Thanks for posting on the forums, and sorry to hear about the issues you are facing.

    You will need to use the actual IP here as it shows in the instruction.

    Please follow the instruction from here

    Also, let me ask my colleague @Ashok for his valuable input on this.

    If you still face the same issue, then could you please grant the support access via the WordPress Dashboard >> WPMU DEV Dashboard >> Support >> Staff Access >> Grant Access. So that I can take a closer look on it.

    Take care!

  • devex

    Thanks to both of you but to be a bit obvious, IS the problem! The instructions can be read in so many ways, which, when you read other threads, are often interpreted differently by different staff members.

    My initial issue was that I couldn't generate the multiple databases in phpMyAdmin using the prescribed code, so everything had to be done manually. No biggie but my phpMyAdmin in Plesk wouldn't allow multiple databases per user, so there had to be a unique user per database. Again, no biggie with 16 databases, but I'd have had a problem with 4096!

    Did everything to the given instructions with move-blogs.php but it just kept hanging up with this unknown user at the _c database. Yes, I did a blank _global database, yes, I used both local and remote IPs, yes to everything really and I changed multiple things to try and get success but it always hung at the same point.

    As my point of failure has been repeated by other users (svteg for one) I assume there is a common problem. Granting you access to my WP isn't going to achieve anything as the issue is external to that, namely in MySQL, phpMyAdmin, File Manager and move-blogs.php.

    Having looked at move-blogs.php it actually doesn't seem to do that much - is there a way of manually doing the same?

  • Jose

    Hey @devex,

    I'm working on your issue and I'll be back to you as soon as I can sort it.

    Please send me the following information via <a href="
    ">contact form:

    - In the subject field add "Attn: Jose”
    - Link back to this thread
    - Include admin/network access
    - Include FTP
    - Include any relevant URLS o information for your site

    On the contact form, select "I have a different question", this ensures it comes through and gets assigned to me.

    Thanks and thank you for your patience,

  • Jose


    In addition, please send me credentials for Plesk, phpMyAdmin, ond anything else that you may consider neccesary.

    Regarding your last question:

    Having looked at move-blogs.php it actually doesn't seem to do that much - is there a way of manually doing the same?

    Please let me check first. I f the script doesn't work, it is because something is wrong. Making manual changes might put us in a worst position.


  • Jose

    Hey again @devex,

    You are good to go now!

    Browse to move-blogs.php and start the process. Let me know if you have issues with that.

    For the records, there were 2 different issues:

    1- Multi-DB do not support different DB users. You must use the same user for all the DBs. Plesk Parallels interface do not allow to do this, but you can achieve it by running the following SQL query:

    GRANT ALL PRIVILEGES ON prefix_global.* TO 'main_db_user'@'%';
    GRANT ALL PRIVILEGES ON prefix_0.* TO 'main_db_user'@'%';
    GRANT ALL PRIVILEGES ON prefix_1.* TO 'main_db_user'@'%';
    GRANT ALL PRIVILEGES ON prefix_2.* TO 'main_db_user'@'%';
    GRANT ALL PRIVILEGES ON prefix_3.* TO 'main_db_user'@'%';
    GRANT ALL PRIVILEGES ON prefix_4.* TO 'main_db_user'@'%';
    GRANT ALL PRIVILEGES ON prefix_5.* TO 'main_db_user'@'%';
    GRANT ALL PRIVILEGES ON prefix_6.* TO 'main_db_user'@'%';
    GRANT ALL PRIVILEGES ON prefix_7.* TO 'main_db_user'@'%';
    GRANT ALL PRIVILEGES ON prefix_8.* TO 'main_db_user'@'%';
    GRANT ALL PRIVILEGES ON prefix_9.* TO 'main_db_user'@'%';
    GRANT ALL PRIVILEGES ON prefix_a.* TO 'main_db_user'@'%';
    GRANT ALL PRIVILEGES ON prefix_b.* TO 'main_db_user'@'%';
    GRANT ALL PRIVILEGES ON prefix_c.* TO 'main_db_user'@'%';
    GRANT ALL PRIVILEGES ON prefix_d.* TO 'main_db_user'@'%';
    GRANT ALL PRIVILEGES ON prefix_e.* TO 'main_db_user'@'%';
    GRANT ALL PRIVILEGES ON prefix_f.* TO 'main_db_user'@'%';

    2- Your db-config.php file had some errors:
    add_db_server('global', 'dc1', 1, 1,'','localhost', 'prefix', 'user', 'pass');
    Should be this:
    add_db_server('global', 'dc1', 1, 1,'','localhost', 'prefix_global', 'user', 'pass');

    Also, I found some typing errors. I recommend you to always use a text editor with syntax highlight. That will help you to detect this kind of mistakes that can be VERY difficult to detect by reading the PHP log errors.
    This is an example (note that there is a missing quote. hard to detect in plain text):
    add_db_server('global', 'dc1', 1, 1,','localhost', 'prefix_global', 'user', 'pass');

    Hope that everything works fine now. Please let me know when you complete the move to multi-DB so that I can mark the thread as resolved, or assist you if necessary.

    Thank you again for your patience!


  • devex

    Thanks Jose, excellent work. Plesk has some strengths, but its handling of databases is probably its worst feature. Thanks for that shared user SQL routine - I'll definitely be using that again! Maybe I missed it, but the original instructions gave the impression that you could use different users (at least I don't think they said you couldn't).

    Sorry about the typing errors - yes, I used plain notepad in this instance rather than the usual Dreamweaver which is on a different machine. That'll teach me!

    I've run the routine and everything ran just fine. As of now please consider this resolved.

    I still think the instructions need an overhaul though...