There isn’t one. There used to be a plugin called wp-hive that did this, but it seems to have fallen by the wayside.
You COULD have a custom wp-config.php that checks for domains and routes to different DB tables, but that’s as close as I can get, and god knows what it’d do to your wp-content.
Thanks for the reply. Can you think of an example I could look at where a wp-config.php points to different databases?
If I have to write some customized code in each wp-config for this to work I think I could deal with that to make it work.
You cannot simply modify wp-config.php to point at multiple databases. If you need those specific requirements and no existing plugin can do that, then you will have to write your own plugin or hire someone to do it for you.
You will have to think exactly what you want your plugin to do besides “have a separate database for each site”. For example what happens if someone creates a new site… how does a new database get created for that site.
Will your WP system really be that big to require multiple databases vs one large database server? Our system is fairly large and we havent come to that point yet (multiple db): 300+ sites, 3000+ tables, 4GB database. We are still on one database server which is mostly idle.
We currently host 900+ websites that all receive a large amount of traffic so yes the demand is there.
As far as creating new databases I already created a PHP interface that creates new MySQL databases with specific user permissions. I then can just plug them in to each wp-config.php or set it to automatically create new wp-config.php files every time I create a new database. That part I’m fine with as that’s simple PHP.
The problem is working with WordPress Multisite and getting each new site/theme to work with each new database.
You cannot simply modify wp-config.php to point at multiple databases
Yes you can. It’s PHP.
Psudeocode follows:
IF domain == domain.com
{ db prefix = wp_foobar_ ; db name = domain.om_sql}
And on and on 🙂 It’s basic PHP if/then checks on the domain name.
I believe WPMUDEV has a plug-in to do what you want.
Outdoorsmen, that plugin is only to create multiple databases. However, each site does not get its own database. I had already looked into that.