Results 1 to 12 of 12
  1. #1

    Can we use the same database for more than one website?

    Hi all,

    I'm just wondering if we can use the same database for more than program? Is this a good practice?
    For example, if we have two websites, one build with Wordpress and the other with Drupal, could we use the same database with its credentials for both websites?
    What are the advantages/disadvantages?

    Your advices are welcome!

    Thank you

  2. #2
    Join Date
    Dec 2011
    Location
    Hertfordshire
    Posts
    455
    In theory you can, although it's generally considered bad practice. If you choose to do so, during installation, use different table prefixes to avoid conflicts.

    e.g. for wordpress you could use wp_ and for drupal dp_.

    However, best practice: one app = one database.

  3. #3
    Join Date
    Apr 2004
    Location
    Pacific Palisades, CA
    Posts
    3,641
    The only downside I can think of is database size. Your host probably restricts size -- either by MB or number of tables. As long as you stay under those, it shouldn't matter.
    Collabora Hosting - Unlimited Windows and Linux Hosting
    Web Security - VPS - Dedicated Servers
    Cloud and Managed WordPress Hosting
    Read how we do Unlimited Hosting at the Unlimited FAQ

  4. #4
    Actually you can!
    But it depends on, if you have used a prefix for first installation!
    Something like, i installed 2 vbulletin forums on 1 Database with vb1 prefix for first installation source and vb2 prefix for 2nd installation source!
    ☆☆ RoyalNode Web Hosting☆☆ In Business Since 2018 (3 Years)
    ►►Los Angeles CA USA, Oregon Seattle USA, Canada, Amsterdam NL EU based Shared and Reseller Web Hosting◄◄
    ►►
    Affordable Managed SSD VPS and Managed Dedicated Server Provider◄◄

  5. #5
    Join Date
    Nov 2011
    Location
    Nasik, MH,INDIA
    Posts
    862
    You can easily run numerous WP-installations in one database. The only thing you need to be aware of is that each wp-installation needs a unique prefix set in wp-config.php, i.e. wp1_, wp2_ or anything you like.

  6. #6
    Join Date
    Nov 2010
    Location
    /home/kristoffer
    Posts
    3,251
    You can, but ensure you specify a prefix and don't let the database get too big. Generally, best practice is to put 1 application in 1 database.
    Serverfruit - awesome cPanel hosting!
    Bacon forever!

  7. #7
    Thanks guys.
    I see opinions diverge!
    There won't be conflicts or slowness when databases get larger and larger?

  8. #8
    Join Date
    Nov 2010
    Location
    /home/kristoffer
    Posts
    3,251
    Quote Originally Posted by Hostalker View Post
    Thanks guys.
    I see opinions diverge!
    There won't be conflicts or slowness when databases get larger and larger?
    That depends on factors such as how large and so on. Generally it is safest to have 1 db per app.

    However you can do the other with prefixes.

    There can come problems with slowness when the db grows. Conflicts would not be there since you use a different prefix for each app.
    Serverfruit - awesome cPanel hosting!
    Bacon forever!

  9. #9
    Thanks Lakridserne.
    I agree with you. It may be better and safer to have separated db.

  10. #10
    Join Date
    Oct 2010
    Posts
    1,785
    It's easier to restore a database from backup than certain tables in a database.
    Hosting is like a box of chocolates, you never know what you're gonna get.

  11. #11
    Join Date
    Feb 2006
    Location
    Kepler 62f
    Posts
    16,703
    Lose one database = lose everything.
    This only sounds like a good idea until it's not. You've been warned!
    || Need a good host?
    || See my Suggested Hosts List || Editorial: EIG/Site5/Arvixe/Hostgator Alternatives
    ||

  12. #12
    Join Date
    Feb 2006
    Posts
    5,393
    As KP mentioned putting all your eggs in one basket can result in an undesirable outcome. Always keep a current mysql dump of your DB, if the DB should ever get corrupted having a recent backup is invaluable.

    Security is another issue that makes sharing DBs impractical. If one site gets hacked all the data in your DB is at risk.
    WHMEasyBackup.com - Take Control Of Your Backups!
    Complete Backup Solution For WHM Reseller Accounts

Similar Threads

  1. Build your own website database
    By sonic10 in forum Software & Scripts Offers
    Replies: 0
    Last Post: 03-18-2012, 04:08 PM
  2. Replies: 3
    Last Post: 09-13-2011, 11:45 AM
  3. Database for a chat website
    By Failsafe Payments in forum Ecommerce Hosting & Discussion
    Replies: 1
    Last Post: 05-13-2007, 01:21 PM
  4. Adding database to my website
    By ts2111 in forum Web Hosting
    Replies: 6
    Last Post: 11-07-2005, 03:48 PM
  5. Database and Website Security
    By oldrelayer in forum Programming Discussion
    Replies: 3
    Last Post: 06-16-2004, 05:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •