Joomla! How-To's: Installation
Installing Multiple Instances of Joomla! With 1 Database
September 22, 2006 | by CoryI just recently installed Joomla! using a database that already had an instance of Joomla! installed in it. It was actually really easy. This article explains how to install multiple instances of Joomla! with 1 database.
Why is this useful?
These days, you can find affordable hosting providers that allow you to run as many MySQL databases as you need. The only limitation is the amount of space they take up. However, there are still some hosting providers out there that only allow 1 MySQL database per hosting account. If you want to run 2 or 3 Joomla! sub sites on your account, you have to be able to install all instances of Joomla! on the one database. Luckily, Joomla! makes a provision for this possibility.
Database Table Prefix
By default, the table prefix for a Joomla! site's database is "jos_". This means that each table in your database will be named "jos_tablename". For example, the content table is named "jos_content".
During installation, you have the option to specify a different table prefix. So, if you are installing 3 instances of Joomla! on your server, you might use the following prefixes:
- Main Site: "jos_"
- Sub Site 1: "sub1_"
- Sub Site 2: "sub2_"
You can use any string value you want for the database prefix, provided it is not longer than the pre-defined table name length specified in MySQL. It is not limited to 3 characters and an underscore. You could use something descriptive like "mainsite", "portfolio", and "photogallery". I recommend keeping it short and using an underscore to set the prefix apart from the rest of the table name.
The table prefix is what Joomla! uses to differentiate your Joomla! tables to other tables that might be in your database. It essentially treats the Joomla! tables as a database within a database, set apart by the table prefix.
That's it. You now know how to use 1 MySQL database to install multiple instances of Joomla! on your server. It really is that easy.
Shared Tables for Multiple Joomla! Installations
Sharing tables (like jos_content, jos_users, etc.) between multiple Joomla! installations gets complicated. In fact, it is well beyond the scope of this article. If you are interested in this type of functionality, you might want to check out Multisites Site Manager PRO.
About the Author
In the years since Joomla! was founded, Cory has built dozens of websites with Joomla! and helped thousands of people find answers to questions about Joomla! through HowToJoomla.net. Cory has also written a book about Joomla titled Beginning Joomla! Web Site Development published by Wrox in April, 2009. In February of 2008, Cory founded Cory Webb Media, LLC, where he provides consulting and web development services for companies of all sizes. You can follow Cory on Twitter @corywebb, or become a fan of Cory Webb Media on Facebook. Cory is also the founder of Themeables, a template club for Joomla!, and developer of /motif, the framework that powers Themeables.
Related Articles
- Must-have Components
- Organizing Your Content
- How to change your WYSIWYG editor
- How to Move Your Joomla! Site to a New Server
- How to Lose the Splash Page
- How to Move your Joomla! Installation Between Directories
- How to use the syndicate (RSS) component in Joomla!
- Joomla! Jargon
- How to turn on SEF URL's
- How to make your site more secure
- Quick Tip: Use JoomlaXplorer to modify your template.
- Packt Publishing Release Book: Building Websites with Joomla! 1.5 Beta 1
- How to change your favicon








