Knowledge base article

Search the support library or follow the guide below.

Step-by-step guidance

How to Create a MySQL or MariaDB Database in cPanel

Create the database container in cPanel before installing or importing an application that needs MySQL or MariaDB. A new database starts without your application's tables. You will also need a database user with appropriate privileges before the application can connect.

Manage My Databases was named MySQL Databases in cPanel & WHM 118 and earlier. Database Wizard can guide you through creating both the database and its user.

Before you start

  • Check that the hosting plan allows another database and identify the application that will use it. Choose a short, descriptive name that follows the on-screen requirements.
  • Use cPanel's database tools rather than phpMyAdmin to create databases and users, so cPanel can manage their ownership and backups correctly.

Instructions

  1. Open database management

    Sign in to cPanel and open Databases, then Manage My Databases. Older versions call this MySQL Databases.

  2. Enter a database name

    Find New Database and enter the name. If cPanel displays an account prefix before the field, enter only the remaining part; cPanel adds that prefix automatically.

  3. Create the database

    Click Create Database and wait for the result. Return with Go Back and locate the new entry in Current Databases.

  4. Record the complete name

    Copy the full name shown in Current Databases, including any account prefix. Your application must use that complete name, not just the part you typed.

  5. Provide application access

    Create or select a dedicated database user, add it to this database, and grant the privileges required by the application. Then install the application or import its database data.

Check the result

  • Confirm the database is listed under the intended cPanel account and the correct user is assigned.
  • Test the application's connection using the complete database and user names and the host specified for your hosting setup.

Troubleshooting

The database name is rejected.
Check the name, any automatic prefix, the displayed length limits, and whether that database already exists. Do not keep adding the prefix twice.
The website cannot connect.
Check the configured database name, user, password, host, and assigned privileges. Creating a database alone does not grant a user access.

Watch the video

The video may show an older interface. Use the written instructions above when screen names differ.

Continue with a related task

Official documentation