Difference between revisions of "Creating a Database for Joomla!"

From Joomla! Documentation

(Some markup and phrasing changes.)
 
Line 1: Line 1:
 
<noinclude><languages /></noinclude>
 
<noinclude><languages /></noinclude>
<translate><!--T:1--> Every installation of the Joomla! CMS requires a database. The database will store data such as articles, menus, categories, and users. This information is needed to make and manage your Joomla! website. Regardless of the '''[[Technical requirements|requirements of the version]]''', in order to install Joomla! you must have a working database, database user, database password and proper privileges for the database user.</translate>  
+
<translate><!--T:1--> Every installation of the Joomla! CMS requires a database. The database will store data such as articles, menus, categories, and users. This information is needed to make and manage your Joomla! website. Regardless of the [[Technical requirements|requirements of the version]], in order to install Joomla! you must have a working database, database user, database password and proper privileges for the database user.</translate>
 
<translate><!--T:2--> You will need to complete these tasks before you begin the installation. This article will address the most common type of database used when [[Installing Joomla!]], a MySQL database. First, we show using [[wp:cPanel|cPanel]] on a hosting account, other types of hosting interfaces should have similar steps. Then we show the same using phpMyAdmin on a localhost XAMPP setup</translate>
 
<translate><!--T:2--> You will need to complete these tasks before you begin the installation. This article will address the most common type of database used when [[Installing Joomla!]], a MySQL database. First, we show using [[wp:cPanel|cPanel]] on a hosting account, other types of hosting interfaces should have similar steps. Then we show the same using phpMyAdmin on a localhost XAMPP setup</translate>
  
Line 7: Line 7:
 
<translate>
 
<translate>
 
<!--T:4-->
 
<!--T:4-->
For beginners, it is recommended the MySQL Database Wizard is used. The wizard will guide you step by step through the process. You may use these steps to guide you through your own hosting account panel if it differs, they are:</translate>
+
For beginners, it is recommended that the MySQL Database Wizard is used. The wizard will guide you step by step through the process. You may use these steps to guide you through your own hosting account panel if it differs, they are:</translate>
 
<translate><!--T:5--> :{{rarr|Create a Database, Create a User, Set User password, Set User Privileges}}. </translate>
 
<translate><!--T:5--> :{{rarr|Create a Database, Create a User, Set User password, Set User Privileges}}. </translate>
  
<translate><!--T:6--> First, activate the wizard by clicking the icon in you hosting account's cPanel.</translate>
+
<translate><!--T:6--> First, activate the wizard by clicking the icon in your hosting account's cPanel.</translate>
  
 
[[File:cPanel-database-wizard-icon-<translate><!--T:7--> en</translate>.png]]
 
[[File:cPanel-database-wizard-icon-<translate><!--T:7--> en</translate>.png]]
Line 18: Line 18:
 
<translate>
 
<translate>
 
<!--T:9-->
 
<!--T:9-->
Next, you must choose a name for your database. In a shared hosting environment, your database name is usually proceeded by your hosting account's username, then an id your specify. For example, if your hosting account's username is B1234, your database name could look similar to this: B1234_joomla.</translate>
+
Next, you must choose a name for your database. In a shared hosting environment, your database name is usually proceeded by your hosting account's username, then an ID you specify. For example, if your hosting account's username is ''B1234'', your database name could look similar to this: ''B1234_joomla''.</translate>
  
 
[[File:cPanel-create-MySQL-database-<translate><!--T:10--> en</translate>.png]]
 
[[File:cPanel-create-MySQL-database-<translate><!--T:10--> en</translate>.png]]
Line 26: Line 26:
 
<translate>
 
<translate>
 
<!--T:12-->
 
<!--T:12-->
Once you have created a database, you now need a 'database user' to access it. This step will create a user and the user's password at the same time. The username for a database will be similar in look to the database name. You can actually use the name of the database for the user, but for security, you should use a unique username with a strong password.</translate>
+
Once you have created a database, you now need a ''database user'' to access it. This step will create a user and the user's password at the same time. The Username for a database will be similar to the database name. You can actually use the name of the database for the user, but for security, use a unique Username with a strong password.</translate>
  
 
[[File:cPanel-create-MySQL-user-<translate><!--T:13--> en</translate>.png]]
 
[[File:cPanel-create-MySQL-user-<translate><!--T:13--> en</translate>.png]]
Line 34: Line 34:
 
<translate>
 
<translate>
 
<!--T:15-->
 
<!--T:15-->
The last task to creating a database for Joomla! is to give your database user privileges(permissions) to interact with your database. These privileges give your user the ability to create database tables, drop them(delete), alter, index and a variety of other interactive tasks.</translate>
+
The last database creation task is to give your database user privileges (permissions) to interact with your database. These privileges give your user the ability to create database tables, drop (delete) them, alter, index and other interactive tasks.</translate>
  
 
[[File:cPanel-set-MySQL-user-privileges.png]]
 
[[File:cPanel-set-MySQL-user-privileges.png]]
 
<translate>
 
<translate>
 
<!--T:16-->
 
<!--T:16-->
* ''If you are not using the database creation wizard. Privileges are usually included in the assignment of a database user to a database. This work flow is {{rarr|Create db,Create db User,Assign a db User to a db(including privileges)}}.''</translate>
+
* ''If you are not using the database creation wizard. Privileges are usually included in the assignment of a database user to a database. This work flow is {{rarr|Create db,Create db User,Assign a db User to a db (including privileges)}}.''</translate>
  
 
<translate>
 
<translate>
Line 50: Line 50:
 
<translate>
 
<translate>
 
<!--T:19-->
 
<!--T:19-->
;Write down the following information for use in your Joomla! installation.</translate>
+
* Write down the following information for use in your Joomla! installation.</translate>
 
 
 
<translate>
 
<translate>
 
<!--T:20-->
 
<!--T:20-->
:* Database name, example: D1234_joomla</translate>
+
:* Database name, example: ''D1234_joomla''</translate>
<translate><!--T:21--> :* Database user, example: D1234_juser</translate>
+
<translate><!--T:21--> :* Database user, example: ''D1234_juser''</translate>
 
<translate><!--T:22--> :* Database user's password</translate>
 
<translate><!--T:22--> :* Database user's password</translate>
<translate><!--T:23--> :* Note the location of the database. Usually, '''''Localhost''''' for a cPanel installation. Occasionally, a hosting account may have a database server completely separate from a user account's server for physical files. Instead of '''''Localhost''''' the database server may actually be a URL type of address, '''''dbserver10.hosting.com'''''.</translate>
+
<translate><!--T:23--> :* Note the location of the database. Usually, ''Localhost'' for a cPanel installation. Occasionally, a hosting account may have a database server completely separate from a user account's server for physical files. Instead of ''Localhost'' the database server may actually be a URL type of address, ''dbserver10.hosting.com''.</translate>
  
 
<translate>
 
<translate>
 
==MariaDB using phpMyAdmin XAMPP on Localhost== <!--T:24--></translate>
 
==MariaDB using phpMyAdmin XAMPP on Localhost== <!--T:24--></translate>
<translate><!--T:25--> Start by opening your XAMPP Control Panel and seeing that it works by going to http://localhost/ You should see the XAMPP welcome page with PHPInfo and phpMyAdmin in the top menu.</translate>
+
<translate><!--T:25--> Start by opening your XAMPP Control Panel and seeing that it works by going to http://localhost/. You should see the XAMPP welcome page with PHPInfo and phpMyAdmin in the top menu.</translate>
 
<translate>
 
<translate>
 
<!--T:26-->
 
<!--T:26-->
Next, we will want to make our root user secure with a password. This can be done in your XAMPP console by opening the Shell and  
+
Next, we want to make our root user secure with a password. This can be done in your XAMPP console by opening the Shell and
type in
+
entering:
mysqladmin.exe -u root password secretpassword
+
''mysqladmin.exe -u root password secretpassword''
This will set the root to use a password. Obviously choose your own and not secretpassword. Make a note of it.</translate>
+
 
 +
This will set the root to use a password. Choose your own and not ''secretpassword''. Make a note of it.</translate>
  
 
[[File:Add password.png]]
 
[[File:Add password.png]]
Line 77: Line 77:
 
<translate>
 
<translate>
 
<!--T:28-->
 
<!--T:28-->
Navigate to your config.inc.php file which is most likely at </translate>
+
Navigate to your ''config.inc.php'' file which is most likely at:</translate>
 +
 
 +
''C:\xampp\phpMyAdmin\config.inc.php''
  
C:\xampp\phpMyAdmin\config.inc.php
+
<translate><!--T:29--> On line 21: </translate>
  
<translate><!--T:29--> On line 21 </translate>
+
''$cfg['Servers'][$i]['password'] = ' ';''
  
$cfg['Servers'][$i]['password'] = ' ';
+
<translate><!--T:30--> You need to add your password. In our example it will look like:</translate>
 
<translate><!--T:30--> You need to add your password. In our example it will look like this</translate>
 
  
$cfg['Servers'][$i]['password'] = 'secretpassword';
+
''$cfg['Servers'][$i]['password'] = 'secretpassword';''
  
<translate><!--T:31--> Now our phpMyAdmin should work we can use to to create a new user</translate>
+
<translate><!--T:31--> Now our phpMyAdmin should work. We can use it to create a new user</translate>
  
 
<translate>
 
<translate>
===Create a new database user using phpMyAdmin XAMPP on Localhost=== <!--T:32--></translate>
+
===Create a New Database User with phpMyAdmin XAMPP on Localhost=== <!--T:32--></translate>
  
 
<translate><!--T:33-->
 
<translate><!--T:33-->
Open phpMyAdmin from the link in the top menu of the XAMPP welcome page and once opened select User accounts in the top menu.
+
Open phpMyAdmin from the link in the top menu of the XAMPP welcome page and select User accounts in the top menu.
Here you will see a page listing the users. Select the Add user account link which is just under the New label.</translate>
+
Here you will see a page listing the users. Select the ''Add user account'' link which is just under the ''New'' label.</translate>
  
<translate><!--T:34--> You will be asked for a User name and a Password and to retype the Password. For local development on your localhost, you can then check the Global privileges Check all box and select go in the bottom right corner.</translate>
+
<translate><!--T:34--> You will be asked for a Username and password and to retype the password. For development on your localhost, in Global privileges, check the ''All'' box. Select ''Go'' in the bottom right corner.</translate>
  
 
<translate>
 
<translate>
===Create a new database using phpMyAdmin XAMPP on Localhost=== <!--T:35--></translate>
+
===Create a New Database using phpMyAdmin XAMPP on Localhost=== <!--T:35--></translate>
  
 
<translate>
 
<translate>
 
<!--T:36-->
 
<!--T:36-->
Now you have your user you can create a new database to add your tables to or allow Joomla to create it for you in the installation process. If you want to name your own then click the Databases tab.</translate>
+
Now that you have your user, create a new database to add your tables to or allow Joomla to create it for you in the installation process. If you want to name your own then click the Databases tab.</translate>
 
<translate><!--T:37-->
 
<translate><!--T:37-->
Fill in the name you would like to use spacing words with underscore so if you want "my database" enter my_database
+
Fill in the name you would like to use spacing words with underscores. If you want "my database" enter ''my_database''.
Select utf8_unicode_ci  and hit Create</translate>
+
Select ''utf8_unicode_ci'' and hit ''Create''.</translate>
  
 
<translate>
 
<translate>
 
<!--T:38-->
 
<!--T:38-->
 
You now have a database, a user and a password and are all set to install Joomla!</translate>
 
You now have a database, a user and a password and are all set to install Joomla!</translate>
 
 
 
 
  
 
<noinclude>
 
<noinclude>

Latest revision as of 16:11, 27 December 2022

Other languages:
Deutsch • ‎English • ‎Nederlands • ‎português • ‎português do Brasil

Every installation of the Joomla! CMS requires a database. The database will store data such as articles, menus, categories, and users. This information is needed to make and manage your Joomla! website. Regardless of the requirements of the version, in order to install Joomla! you must have a working database, database user, database password and proper privileges for the database user. You will need to complete these tasks before you begin the installation. This article will address the most common type of database used when Installing Joomla!, a MySQL database. First, we show using cPanel on a hosting account, other types of hosting interfaces should have similar steps. Then we show the same using phpMyAdmin on a localhost XAMPP setup

MySQL DB Wizard[edit]

For beginners, it is recommended that the MySQL Database Wizard is used. The wizard will guide you step by step through the process. You may use these steps to guide you through your own hosting account panel if it differs, they are:

Create a Database  Create a User  Set User password  Set User Privileges.

First, activate the wizard by clicking the icon in your hosting account's cPanel.

CPanel-database-wizard-icon-en.png

Creating a Database[edit]

Next, you must choose a name for your database. In a shared hosting environment, your database name is usually proceeded by your hosting account's username, then an ID you specify. For example, if your hosting account's username is B1234, your database name could look similar to this: B1234_joomla.

CPanel-create-MySQL-database-en.png

Creating a Database User and User password[edit]

Once you have created a database, you now need a database user to access it. This step will create a user and the user's password at the same time. The Username for a database will be similar to the database name. You can actually use the name of the database for the user, but for security, use a unique Username with a strong password.

CPanel-create-MySQL-user-en.png

Set the User Privileges[edit]

The last database creation task is to give your database user privileges (permissions) to interact with your database. These privileges give your user the ability to create database tables, drop (delete) them, alter, index and other interactive tasks.

CPanel-set-MySQL-user-privileges.png

  • If you are not using the database creation wizard. Privileges are usually included in the assignment of a database user to a database. This work flow is Create db  Create db User  Assign a db User to a db (including privileges).

Finishing Up[edit]

After you complete all the steps of the database wizard, you will see the summary of the final results.

CPanel-MySQL-database-wizard-finished.png

  • Write down the following information for use in your Joomla! installation.
  • Database name, example: D1234_joomla
  • Database user, example: D1234_juser
  • Database user's password
  • Note the location of the database. Usually, Localhost for a cPanel installation. Occasionally, a hosting account may have a database server completely separate from a user account's server for physical files. Instead of Localhost the database server may actually be a URL type of address, dbserver10.hosting.com.

MariaDB using phpMyAdmin XAMPP on Localhost[edit]

Start by opening your XAMPP Control Panel and seeing that it works by going to http://localhost/. You should see the XAMPP welcome page with PHPInfo and phpMyAdmin in the top menu. Next, we want to make our root user secure with a password. This can be done in your XAMPP console by opening the Shell and entering: mysqladmin.exe -u root password secretpassword

This will set the root to use a password. Choose your own and not secretpassword. Make a note of it.

Add password.png

Now your phpMyAdmin will break so we need to fix that.

Navigate to your config.inc.php file which is most likely at:

C:\xampp\phpMyAdmin\config.inc.php

On line 21:

$cfg['Servers'][$i]['password'] = ' ';

You need to add your password. In our example it will look like:

$cfg['Servers'][$i]['password'] = 'secretpassword';

Now our phpMyAdmin should work. We can use it to create a new user

Create a New Database User with phpMyAdmin XAMPP on Localhost[edit]

Open phpMyAdmin from the link in the top menu of the XAMPP welcome page and select User accounts in the top menu. Here you will see a page listing the users. Select the Add user account link which is just under the New label.

You will be asked for a Username and password and to retype the password. For development on your localhost, in Global privileges, check the All box. Select Go in the bottom right corner.

Create a New Database using phpMyAdmin XAMPP on Localhost[edit]

Now that you have your user, create a new database to add your tables to or allow Joomla to create it for you in the installation process. If you want to name your own then click the Databases tab. Fill in the name you would like to use spacing words with underscores. If you want "my database" enter my_database. Select utf8_unicode_ci and hit Create.

You now have a database, a user and a password and are all set to install Joomla!