Posts Tagged: WordPress


27
Jul 09

Connecting More Than One Wordpress Blog to A Single MySQL Database

wordpress-logoLimited resources and controlling costs is becoming a bigger issue for businesses including web designers.  As I’ve developed a great deal of websites over the past couple of months, I’ve been running into the problem of a limited amount of MySQL Databases as part ofmy hosting deal from BlueHost.

It’s the price to pay for having such an incredible host, and hopefully in the future I can get into a formal review of it.

But for now, I want to go over the steps for connecting one or more Wordpress Blogs to a Single MySQL Database.

There are several different ways to install WordPress, but seeing that the vast majority of hosts use One-Click installation processes, I’ll assume that you have already installed one Blog.

  1. Open up the WP-Config.php file on your server.
  2. Write down the different MySQL Settings, i.e. DB_NAME, DB_USER, etc.  Also, scroll a bit down and make note of the $table_prefix name.
  3. Install your second WordPress Blog.
    * Thankfully Bluehost uses SimpleScripts to install WordPress Blogs automatically.  The second step of the installation process through SimpleScripts allows you to unselect “Automatically create a new database” and manually enter the information that you copied from WP-Config.php of the first blog.
    ** If you are using SimpleScripts to install your second site, make sure that you give the Table Prefix of your second blog a different name than the Table Prefix of the first blog.
  4. If you manually install your blog, edit the WP-Config.php file of your second site and manually change the settings.  Again, put in the same DB_NAME, DB_USER, etc., and a different $table_prefix.

And that’s all there is to it.  To my understanding the amount of tables that a single MySQL database can hold is infinite.