6

Before you install Joomla do you need to create the database first?

6 Answers 6

7

No, when installing for MySQL there is no need to create the database first. The credentials (Username and password) you use to connect to the database server do need to have the permissions to create a database. The database server needs to exist and be running for the Joomla installation to create the database. Some providers don't allow this and give you credentials for a specific database.

Yes, when installing for MSSQL or PostgreSQL the database needs to exist before installing Joomla. They don't allow to attach to the database server and create the database upon installation. If you are not provided an existing database you need to create the database using the management tools of the RDBMS or request your provider to create one.

The installation also allows you to point to an existing database. This allows you to have more than one installation in the same database.

9
  • I've almost always had to create the database first in MySQL. Apr 25, 2014 at 15:43
  • I never do, can't even recall the syntax. If I have to, I always lookup the syntax in the Joomla database driver. Something to do with "CHARACTER SET utf8;"
    – sovainfo
    Apr 25, 2014 at 15:58
  • 2
    Not sure what host you're using but every single cpanel type server I've ever used required me to make any databases I wanted. Plesk is the same way I believe, as is godaddy.
    – Brian Peat
    Apr 25, 2014 at 16:08
  • A vps, a provider that allows database creation on the database server and a provider that only allows one database they created. And of course all those local XAMPP installs (W-XP, W7 and W8.1)
    – sovainfo
    Apr 25, 2014 at 16:16
  • I use mamp and it's empty until I create a DB in it. I can't imagine XAMPP comes with a bunch of premade databases that are empty. I still stand by my answer. In most setups, you absolutely have to create a database (and usually the user too). In a mamp/xamp setup the user is already made, but not the database (in my experience).
    – Brian Peat
    Apr 25, 2014 at 19:42
2

Yes and no. The documentation says this:

  1. Create the Database
  2. Create a database user and password
  3. Add the user to the database (which also involves checking ALL boxes for permissions)

This is easy to do in Cpanel. I can't say much for other admins. It's also pretty easy to do in Godaddy's dashboard.

Here's the Joomla doc article about this:

http://docs.joomla.org/Creating_a_Database_for_Joomla!

BUT, as others have pointed out in their answers, if you enter your mysql username and password, and that database user has full create access, all you need to do is:

  1. Enter the database user and password
  2. Enter the name of the database you want created for you.

Here's the important part when creating your database user. Make sure all the boxes are checked like the image here shows:

http://docs.joomla.org/File:CPanel-set-MySQL-user-privileges.png

If that isn't done right, joomla won't be able to create the database for you.

I had no idea this was even a feature because I've never seen it documented anywhere that I've read. It was a new one for me. :)

2

It is not advisable to use the root MySQL password (or any user with such high permissions) just to skip the database creation. On cPanel you can create one in under 30 sec.

If you are installing multiple Joomla instances on a single database (with different prefixes), please, create a separate user for each site, for added security. A single database can have multiple users associated to it, so, if one site config leaks (hacked, whatever), you can just revoke this user, instead of having to mess with all other instances.

There is no such thing as "secure enough", much less something even remotely resempling "easy recurity".

So, yeah, web is tough. Human up!

(better start using gender neutral now).

1

It's very important that You will need to enter the information about the database you will use for Installing Joomla.

Creating Db is very important before you installing any joomla Package ,During Installation it will create tables .Entering the Database name , Table prefix, plays a main role in Installation .By giving all the database related details after installation Complete successfully.So it's very Important need a db in the name of your site before installing joomla . Say Example your Site name is example . then you need to create DB in the name example before you install.

If you need to create a database, please read  http://docs.joomla.org/Creating_a_Database_for_Joomla! first or skip to step #2.
You will need to note basic database information needed when the actual Joomla! installation is started.
    Location of datase, localhost? Or a specific host's server such as dbserver1.yourhost.com
    The database name
    The database user's name

The database user's password

During Installation you need to enter set the values in
For simplification, these intructions are a reference to installing with a MySQLi database. The instructions on the installation page are self explanatory, but here they are again:

Database Type: MySQLi is the common database used

Hostname: Where is your database located? Common is localhost, but some hosts use a specific database server such as dbserver1.yourhost.com

Username: The username used to connect to the database

Password: The password for the database's username

Database Name: The name of the database

Table Prefix: One is generated automatically, but you can change it. For example, jos3_ can be used. Just don't forget to put the underscore character(_) at the end of the prefix.

Old Database Process: Should the installer backup or delete existing tables during the installation of new tables? Click, Yes or No to select the choice. 

for more Detail:http://docs.joomla.org/J3.2:Installing_Joomla#tab=Requirements

1

The answer to this question is purely based on your environment. If you're using a username and password that has the role to create databases, then you won't need to create a database beforehand. In this case no, it's not required to create the database ahead of time.

In the second case, I believe most shared hosts are not going to give you access to a user like that, so you'll have to create a new database user, password, and authorise that user on a new database. So in this case yes, it is required to create the database ahead of time.

There's no constantly correct answer here. It's all about environment, and more so best practices. In my opinion I don't want a database user to have access to more than just one database. It prevents that user from being able to do things it shouldn't. In the case of a breach in security of some sort, ideally that user is contained to a smaller area where damage can be done.

0

The database will need to be created, although it will be empty and have no tables per se.

When running the Joomla installer, it will prompt you to provide the database host, database username, and database password. It will then proceed to seed the database with the necessary tables and data.

1
  • 1
    Upon installation of Joomla you'll be prompted also for the database. You have a choice to provide an existing database or new one (when using MySQL). This allows you to have a database J330 with tables for J330b1_,J330b2_,J330RC1_ and J330_. Or if you prefer you can have databases alpha, beta, rc and ga with the appropriate prefixed tables in each.
    – sovainfo
    Apr 26, 2014 at 8:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.