justuptime.com - monitor your servers & websites

Sharing a MySQL Database

You are viewing this site as a guest. Join our community to get your questions answered and share knowledge. Active members may advertise and ask for a website critique.
Monkeyboy's picture

He has: 199 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

J's World Welcome to my world

andy206uk's picture
DeveloperModerator

He has: 1,754 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)

Andyk

Blog of a Web Designer
Give a man a fish and you feed him for a day. Teach him to use the Net and he won't bother you for weeks.

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.

Monkeyboy's picture

He has: 199 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

J's World Welcome to my world