Did you know that you can host multiple WordPress installations on the same MySQL database? If no, then this article is for you.
There can be many benefits of hosting multiple WordPress installations on the same MySQL database. Usually hosting providers have a limit of how many databases you are allowed to create with their service. Or, it may become too cumbersome to maintain multiple databases. Or, you may want to group together related blogs under the same physical database. Regardless of what your requirement is, it takes very little to host multiple installations on one database.
All it takes is a small change to the wp-config.php file for your blog. Take a look at the screen shot of a wp-config.php file:
Notice the highlighted area. By default the value of $table_prefix is ‘wp_’.
You can set this value to anything you want. The trick is to do this before you install WordPress. If you set the prefix to something which is specific to the blog that you are installing, then WordPress will automatically create the tables for that blog with the proper prefixes.
This allows you to install as many blogs as you want on the same database. So, if you wanted to install another blog on this database, you would simply give another prefix to the second blog.
I use this method all the time. Because when I do this, I don’t need to backup each blog individually. I simply backup one single database and all my blogs get backed up.
Note, this shouldn’t be confused with WordPress MU, which is totally different beast all together. This is for installing WordPress single user, but multiple instances of it.