Houston, we have a problem!

Before I get asked...

- I've triple checked.
- Followed instructions to the T as far as I can see
- 4096 databases
- using cPanel
- removed white space from db.php and closed php tag

When I access move blogs I get:

Houston, we have a problem!
Looks like you need to create your new db's! If you're lucky, this link still works - click me
Database Error: Access denied for user 'linkdir_wp'@'localhost' to database 'linkdir_wordpressglobal'

Would love to know where that 'click me' used to go, but more importantly, would love to get Multi-db working.

There are a few posts about this, so I've perused, and tried various things:

1. Someone suggested that cPanel '256 buggers' script was my solution... that in fact the user has not truly been assigned to the databases. That script is no longer online. But that may not matter as yet another person has posted that move-blogs.php does this very thing.

2. Another person mentioned that there needed to be at least one child site created with the Wordpress Network. Would love to give that a whirl, but as it stands I can't get to the site at all... 'Error establishing a database connection'.

3. Another suggested that the $newdb_prefix in move-blogs.php should not include a trailing underscore. I can't fathom how that would work since it makes some assumptions, but I tried it and it also failed.

4. Yet another had luck by changing their db password. No luck there either.

5. Finally, someone else somehow had luck using their cPanel username. Can't even imagine how that could possibly work, so I skipped that altogether.

So... does move-blogs replace the need for the "256 bugges" script? Should I simply be quadruple-checking? Or, should I be finding a way to manually add the user? Am I even close?

Thanks!

  • DavidM
    • DEV MAN’s Mascot

    Hi notabledesign,

    First off, thanks for your patience with this one, as Multi-DB can take a bit of troubleshooting and I can see you've gone through quite a bit thus far.

    That said, could you possibly place your db.php and db-config.php in a zip file and attach it here so we could take a look at it?

  • notabledesign
    • WPMU DEV Initiate

    Update:

    I managed to add my user to the _global db, which enabled me to run move-blogs.php. I presume that the user won't actually be able to access all of the other databases, however. Besides that, I still get 'Error establishing a database connection' when trying to access the site.

    I have attached the files as requested. Let me know what you see.

    Thanks in advance for your help, David!

  • DavidM
    • DEV MAN’s Mascot

    Strange, I'm able to attach zips from here. Could you try renaming them as txt files (db.txt and db-config.txt) and attaching them that way?

    Also, regarding your 'Error establishing a database connection', was that an issue before using Multi-DB (before executing move-blogs.php)?

  • notabledesign
    • WPMU DEV Initiate

    Zipped files attached as .txt

    You made me realize something with your question... I think the database error issue came up while I was trying the various methods to fix things. One of those was changing the database user password. I can't think of any reason changing the pass would affect things (unless of course I hadn't also changed it in wp-config and db-config), but if I recall that IS when the error came up.

    Thanks again for your help here.

  • DavidM
    • DEV MAN’s Mascot

    Hi notabledesign,

    I didn't happen to notice an email come through for this, have you tried sending that through? And if you'd like to try attaching even an image/screenshot of the settings, I could take a look at that instead, though an emailed copy would be preferable.

    Just let me know and I'll take a look into it. :slight_smile:

  • notabledesign
    • WPMU DEV Initiate

    Finally got back to it.

    I had the host add the user to the db via a script (having said that, the user assignment is still not synched with cPanel). When revisiting the site, I still got the DB error, so I dove into phpMyAdmin to try Karel's fix. Looked up Reload Privileges, and not being overly confident, I thought I would at least [finally] send Dave my plugin files to review...

    ... and that's when I saw it.

    I went to start taking my db passwords out of the files, and noticed that my first 'add_db_server' line (global) was reading...

    add_db_server('000', 'dc1', 1, 1,'','localhost', 'linkdir_wordpressglobal', 'linkdir_wp', '******');

    Note the '000' instead of 'global' as the first parameter.

    I changed it to 'global', and voila! Site loads... which is a good sign to say the least. Off to see what I may have messed up in the interim :slight_smile:

    Thanks for you help with this. Really appreciate it. Hopefully i won't be back with bad news any time soon.

    Cheers!

  • notabledesign
    • WPMU DEV Initiate

    Ok. Well.. back again.

    I'm guessing something got messed because of the previous issue since I ran move-blogs before fixing the 'global' problem. But its just a guess.

    The sites that I had previously created all load fine, but when adding new ones I get:

    The website encountered an error while retrieving http://mydomain.com/wp-admin/network/site-new.php?action=add-site. It may be down for maintenance or configured incorrectly.

    Any thoughts?

    Thanks again!

  • Mason
    • DEV MAN’s Sidekick

    Hiya notabledesign,

    Can we get a link to your main site and one of the broken ones? If we can see the actual error and look at the redirection that may help.

    Also, are you running a sub-domain or sub-directory version of WordPress multisite?

    Do we know whether the sub-sites worked before multi-db?

    Thanks.

  • notabledesign
    • WPMU DEV Initiate

    Hey again,

    I'm stumped. I've looked over the multi-db files again (and am sending them to you after this post, David). Some notes (which I will include in my email):

    1. When I create a new blog, I get a 500 server error. From everything I can see, most people attribute them to .htaccess issues. I've triple checked mine and they seem fine. Having said that, the second thing that people are saying is they can be attributed to is Mod Rewrite. I am fairly certain Mod Rewrite is enabled as the original blog I created (pre-multi-db) works just fine.

    2. I also did some sniffing around since the 500 error specifies that /wp-admin/network/site-new.php?action=add-site is causing the problem. The interesting part here is that when I create the new blog I can see that it stores the insert_blog data ($domain, $path and $site_id), but doesn't get as far as adding the user (from within wpmu_create_blog). Of course, once again I am seeing that it is likely due to a config issue.

    3. I noticed that after I ran move_blogs, the original site that I created seems to copy, however when I check the database it exists in both the original wordpress db and one of the databases created by multi-db. This may be expected behaviour, but I thought it was worth mentioning.

    4. The more curious part of this is that the blog was moved to [prefix]c81, as opposed to say [prefix]000. Again, this may be expected behaviour, but I would have guessed the blogs would have been moved to databases sequentially.

    And that's all I have to report for now. Sending files pronto.

    Thanks again,

    Ben

  • Mason
    • DEV MAN’s Sidekick

    1. When I create a new blog, I get a 500 server error.

    Yeah, I really believe this to be a config issue. You're right htaccess and mod_rewrite are 99% of the time the culrpits. I can't think of any other reason they'd network 500.

    I also did some sniffing around since the 500 error specifies that /wp-admin/network/site-new.php?action=add-site is causing the problem.

    Where is this being hosted? Are you sure you're running at least PHP 5?
    Try putting this ABOVE your wordpress calls in .htaccess

    AddType x-mapp-php5 .php
    AddHandler x-mapp-php5 .php
    Options -MultiViews

    Some hosts don't have PHP5 enabled by default.

    4. The more curious part of this is that the blog was moved to [prefix]c81, as opposed to say [prefix]000. Again, this may be expected behaviour, but I would have guessed the blogs would have been moved to databases sequentially.

    No, it doesn't move sequentially. It uses the md5 of the blog id and then depending on the number of databases you have you take the first 1, 2 or 3 characters of the md5.

  • notabledesign
    • WPMU DEV Initiate

    Back again.

    1. mod_rewrite is enabled.

    2. I am running php5. When I add the above to my htaccess, I can read the source.

    Stumped again.

    @DavidM Any luck with the files I sent?

    Thanks again guys. I appreciate your attention to this.

    Starting to think I may ask someone here to do the dirty work for me. I would much rather have a firm grasp of it, but my client is starting to itch.

  • notabledesign
    • WPMU DEV Initiate

    Eureka!

    Seems my last problem had nothing to do with htaccess, mod_rewrite, php5, or multi-db.

    I noticed that there was a new version of WP available, and went to auto-update thinking that it might resolve my problem. Auto-update failed. So, I re-CHMODded wp-content/update and upped the php memory limit. Neither managed to fix auto-update issue, so I manually updated and... voila! 500 error fixed!

    I'm not sure what did the trick, the WP update or the memory limit. I suppose it could have been either, really... would limited allocated memory (32M) cause a multi-db set-up to wig-out? Or, any WP network, for that matter? I wish I could test it without having to go through a third party, but unfortunately I have limited system access and can't play with memory_limit as I please.

    In any case, multi-db seems to be rolling. Thanks so much for all of your help boys and girls. Really appreciate the time you've put into my adventure. I suppose I shouldn't speak too soon since my tests thus far have been few, but I think its time to put this topic to rest. Catch you on another one!

  • Mason
    • DEV MAN’s Sidekick

    Hiya notable,

    Probably was something in the update that solved it. Sometimes a fresh installation of WordPress does the trick. I always advise 128 MB for the php memory limit when running a WordPress Multisite though. 32M is pretty tiny and could also be the issue.

    Let us know how it goes though. Hopefully won't be an issue again! Thanks!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.