PDA

View Full Version : Clear my misunderstanding: 1 MySQL database for many programs?



iKwak
08-21-2005, 12:31 AM
Hello there,

I been using CPanel for more than two years and I need to know something about MySQL.
I frequently use PHP and MySQL to install softwares for websites. My webhost offered 10 MySQL databases for my use.

So far, I have used up all 10 databases to install 10 programs (Wordpress, Invision Board, gallery scripts, and etc.).

I recently found out that I can install two programs using only 1 database! I can use the same database name and password and only alter the table name.



My question to you: Can I use only 1 MySQL database to install 3 different programs under one domain?
i.e. websitepublisher.com, websitepublisher.com/forums/ (vBulletin), websitepublisher.com/blog/ (Wordpress), and websitepublisher.com/books/ (some script) with 1 MySQL database


Thank you in advance.

AndyH
08-21-2005, 12:41 AM
Yes - I don't know if you just wanted the answer or more information?

vatsia
08-21-2005, 05:13 AM
As long as the scripts have different table names :)

Let's say you have 2 scripts which use 2 databases with db1,userdb1,passdb1 and db2,userdb2 and passdb2. If you like to make both scripts use db1 then you have to export the tables of db2 (from phpmyadmin) and import them into db1(via sql window of phpmyadmin),after this you would have to find the configuration file of the second script and change the db connection data from db2,userdb2,passdb2 to db1,userdb1,passdb1.
That's all. :)

Masetek
08-21-2005, 05:14 AM
Yeah u can. Just make sure the table names are different. Which they should be, because most progs have a table prefix. like wp_ for wordpress.

iKwak
08-21-2005, 10:40 AM
I appreciate the response guys.
Very informative and I understand it now.