views:

18

answers:

1

I need

  • few Wordpress sites for testing purposes.
  • It would be great if I can use only one db
  • but I need few wordpress codes/instalations (because I need different settings and plugins for each site.

Can I have all that running on one mySQL db? Would use the same db_name, db_user, db_password, etc… and the only thing I change for the every other blog is the prefix?

+1  A: 

It should be perfectly possible. when you setup wordpress there's a field to specify the table prefix (default is wp_) when setting up the database. These settings are also stored in wp-config.php

jay.lee
so if I change the prefix `wp_` to something else it will do the job?
Radek
yes, just use a different prefix for each installation. However, if you have a plugin that creates DB tables without using the prefix you may encounter some problems.
jay.lee
you mean without the correct prefix? so it could happen that plugin from xyz site would write to yyy site database :-)
Radek
I meant that some plugins create their own database tables (separate from WPs) and they may disregard the prefix. So having multiple installs of the plugin on the same DB may result in them all pointing to the same place.
jay.lee
cool, thank you for the clarification. I like your avatar.
Radek