Howdy! I’m looking to share one database between multiple installs for the purpose of sharing users and usermeta tables. Where do I change the path to the database for the additional installs to match the first install?
I haven’t tested this, but this is where I’d start:
DB_HOSTin wp-config.php on the sites using the other site’s database to:
- Create a new user on the database you wish to share that allows remote connections. You can do this with Adminer or Sequel Pro.
DB_PASSWORDto the user created in the step above.
DB_NAMEto the remote database name
I haven’t tried what Clay recommends and it looks like it would work, but maybe you can approach the problem from a different direction.
I’ve occasionally turned to WordPress Multisite when I need to have the same users on different sites. It does add additional complexity to the overall system, however depending on your needs, it might be just the solution that you need.
I think this article does a decent job of outlining the big concerns to think about when approaching multisite: https://premium.wpmudev.org/blog/ultimate-guide-multisite/
Thanks, Clay! I’ll give that a try.
Thanks, Ben! Good suggestion. I was hoping to avoid those complexities, but I think I’m in a scenario that is a good fit for Multisite.