Sharing a MySQL Database

aka Rohan's picture

He has: 200 posts

Joined: Feb 2006

Is it possible to have two applications sharing the same MySQL database?

The reason I ask is that my two databases allowed by my host are being used (by Wordpress and Gallery2) and I've just found a Sports ladder program i'd like to set up on my website but it also requires MySQL. Roll eyes

He has: 1,758 posts

Joined: Jul 2002

Hi,

As long as neither application requires the same table name, it should be absolutely fine. That is why most scripts give you table prefix option in the config file. Just set one to wp_ and the other to g2_ and hey ho, problem solved. Shocked)

Andy

FrankR's picture

He has: 45 posts

Joined: Oct 2006

As Andy pointed out, as long as the table names are all unique everything will work. However, even with prefixes things may be a little trickier to backup or migrate in the future. You might consider asking the web hosting provider if they can up the limit of databases. Sometimes providers will do this without a fee.

Frank

Author of SQL Converter for Excel, which is an Excel add-in for converting data to MySQL.

aka Rohan's picture

He has: 200 posts

Joined: Feb 2006

Cool thanks for the replies guys, i'll see if my host will up my limits but failing that i'll give the prefix method a shot. Smiling

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.