For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /cpanel/database_management/how_to_create_a_database_and_database_user_in_cpanel.md.

How to Create a Database and Database User in cPanel

You can create a MySQL database, create a database user, and assign privileges to the user using the Manage My Databases section in cPanel.

Access Manage My Databases

Log in to cPanel

Log in to your cPanel account.

Open Manage My Databases

In the Databases section, click Manage My Databases.

Manage My Databases option in cPanel

Create a Database

Enter the database name

In the Create New Database field, enter a name for the database.

Create the database

Click Create Database.

Create a new database in cPanel

A confirmation message will appear after the database is created successfully.

Create a Database User

Open the Database Users section

On the Manage My Databases page, scroll down to the Database Users section.

Database Users section in cPanel

Enter the user credentials

Enter a username and a secure password in the Username and Password fields.

Create the user

Click Create User.

Create a database user in cPanel

A confirmation message will appear after the user is created successfully.

Warning

Use a strong and unique password for the database user and keep the credentials secure.

Add the User to the Database

Open the Add User to Database section

Scroll down to the Add User to Database section.

Select the user and database

Select the database user and database you created from the respective dropdown menus.

Add the user

Click Add.

Add a database user to a database in cPanel

Assign database privileges

You will be redirected to the Manage User Privileges page.

Select ALL PRIVILEGES to grant the user full access to the database, or select only the required privileges.

Save the privileges

Click Make Changes to save the changes.

Note

Grant only the privileges required by the application whenever possible.

Manage User Privileges

Locate the existing database

To modify the privileges of an existing database user, scroll to the Current Databases section on the MySQL Databases page.

Current Databases section in cPanel

Open the user's privileges

Under the Privileged Users column, click the name of the user you want to modify.

Update the privileges

Select or deselect the privileges you want to assign or remove.

Manage database user privileges in cPanel

Save the changes

Click Make Changes to save the updated privileges.

Your database, database user, and user privileges have now been configured successfully in cPanel.