How to Create a Database for a New Joomla Installation

Joomla needs a database, a database account that can manage Joomla’s tables, and the correct connection details before the installer can finish. The safest setup gives Joomla its own database and its own database user instead of reusing a server-wide administrative account.

What Joomla needs

Before opening the Joomla installer, prepare these values:

  • Database type — commonly MySQL/MariaDB through MySQLi, or PostgreSQL where supported.
  • Database host — commonly localhost, but use the exact hostname supplied by your provider.
  • Database name.
  • Database username.
  • Database password.

The Joomla Super User username/password are separate credentials and should not be reused as database credentials.

Option 1: Create the database in your hosting control panel

On shared or managed hosting, this is normally the best method because the host may automatically add an account prefix to database and user names.

  1. Open the host's database-management section or MySQL/MariaDB database wizard.
  2. Create a new empty database for the Joomla site.
  3. Create a dedicated database user with a long, unique password.
  4. Assign that user to the new database.
  5. Grant the user the privileges required to create, alter, index, insert, update, and delete Joomla's tables inside that database. Many hosting panels present this as All Privileges for the selected database.
  6. Record the final database name and username exactly as the host displays them. Hosting account prefixes are part of the real names.
  7. Record the database hostname shown by the provider. Do not assume it is your website's domain name.

Option 2: Create a MySQL or MariaDB database with SQL

Use this only if you administer the database server and understand the account/host rules on that server. These are write operations. Do not run them against an existing database name or reuse the example password.

CREATE DATABASE joomla_site
  CHARACTER SET utf8mb4
  COLLATE utf8mb4_unicode_ci;

CREATE USER 'joomla_user'@'localhost'
  IDENTIFIED BY 'replace-with-a-long-random-password';

GRANT ALL PRIVILEGES ON joomla_site.*
  TO 'joomla_user'@'localhost';

If Joomla connects from a different host, the MySQL/MariaDB account's host portion must match your database architecture. Do not replace localhost with % merely to make a connection work; broad remote access should be a deliberate server-security decision.

Option 3: Create a PostgreSQL database

If you are using PostgreSQL and have administrative rights, the equivalent pattern is to create a dedicated login role and make it the owner of the Joomla database. Adapt names and password policy to your environment:

CREATE ROLE joomla_user
  LOGIN PASSWORD 'replace-with-a-long-random-password';

CREATE DATABASE joomla_site
  OWNER joomla_user
  ENCODING 'UTF8';

Managed PostgreSQL services may require you to create the role/database through the provider instead of direct administrative SQL.

Verify the database credentials before installing Joomla

For MySQL/MariaDB, if a command-line client is available:

mysql -h DATABASE_HOST -u DATABASE_USER -p DATABASE_NAME

After connecting, a harmless read-only test is:

SELECT 1;

For PostgreSQL, a comparable connection test is:

psql -h DATABASE_HOST -U DATABASE_USER -d DATABASE_NAME

If the connection test fails, fix the hostname, username, password, database assignment, or server access rule before opening the Joomla installer.

Enter the database in the Joomla installer

When Joomla reaches Database Configuration, enter the exact values you prepared. For a typical MySQL/MariaDB installation:

  • Database Type: MySQLi.
  • Hostname: the provider's database host, often localhost.
  • Username: the dedicated database user.
  • Password: that database user's password.
  • Database Name: the empty database you created.
  • Table Prefix: normally accept Joomla's randomly generated prefix.
  • Connection Encryption: use the database host's required setting; otherwise leave the default.

Common database-creation mistakes

  • The user exists but is not assigned to the database. Joomla can authenticate but cannot create tables.
  • The host prepends an account name. You entered joomla but the real database is something like account_joomla.
  • The database host is wrong. The website domain and database hostname are not interchangeable.
  • You used the server's root/admin database account. Joomla should have a dedicated account limited to its own database.
  • You reused an existing database without understanding its contents. Use a clean database or a unique table prefix only when you deliberately intend to share a database.
  • Remote database access is blocked. If the database lives on another server, firewall, TLS, bind-address, or account-host rules may need configuration by the server administrator.

Verify after Joomla installs

After a successful installation, confirm the frontend and Administrator both load, then check Joomla System Information to confirm the expected database type and version. Keep the connection details in a secure credential store; do not put database passwords in public documentation, tickets, screenshots, or source repositories.


Need More Help with Joomla?

Still having trouble? Open a support ticket with QuantaCade Support and we'll be happy to help where we can.

Support priority is given to QuantaCade products, services, and customers. However, we're also happy to assist fellow Joomla users with general Joomla questions and troubleshooting when possible.

QuantaCade is an independent Joomla extension developer and is not official Joomla support. Some issues involving third-party extensions, hosting environments, server configurations, or other systems outside our development control may be beyond what we're able to resolve.

Open a Support Ticket