Skip to main content

cPanel Guide

Here's How to Create a MySQL Database in cPanel (Plus a User to Match)

Set up a database and user with the correct privileges in cPanel, and collect the exact credentials an app like WordPress needs to connect.

4 Fields

Host, database name, username, password an app needs

MySQL

Database engine used by cPanel's database tools

Free

phpMyAdmin included for direct database management

Daily

Backup frequency covering databases on the account

In short

Here's how to create a MySQL database in cPanel: open MySQL Databases (or the MySQL Database Wizard), enter a database name and click Create Database, then create a separate database user with its own password. Add that user to the database and grant it All Privileges so the application can read, write, and manage tables inside it.

cPanel prefixes both the database name and username with the account's cPanel username automatically, so the actual name an app needs to connect with is usually longer than what was typed in the form.

Most dynamic applications — WordPress, WooCommerce, forums, custom PHP apps — need a MySQL database to store content, and cPanel provides two ways to set one up: the step-by-step MySQL Database Wizard, or the more direct MySQL Databases tool for anyone who already knows the steps. Either way, a database on its own does nothing until a user is created and linked to it with the right privileges.

This guide covers both tools, explains the cPanel username prefix that trips up first-timers, walks through assigning privileges correctly, and shows where to find the four pieces of information — host, database name, username, password — that any application's configuration file will ask for.

How to Create a MySQL Database in cPanel, Starting With the Database

In cPanel's MySQL Databases tool, the 'Create New Database' field only needs the part of the name being chosen — something like store or wpblog — because cPanel automatically prepends the account's cPanel username and an underscore, turning it into something like cpuser_store behind the scenes. That full prefixed name is what actually gets used everywhere else, including in any app's configuration.

Clicking Create Database adds it to the list on the same page instantly; at this point the database exists but is completely empty and has no user with any access to it yet, so nothing can connect until the next step is done.

Creating a Database User and Setting a Password

Below the database creation section, 'MySQL Users' has its own 'Add New User' form, which takes a username (also automatically prefixed with the cPanel username) and a password. cPanel includes a password generator here, and using it for a strong, random password is worth doing since this credential often ends up stored in plain text inside an application's configuration file.

The username created here is entirely separate from the database name — they can match in spirit (a user called store for a database called store) but they're two distinct objects in MySQL, and creating a user does not automatically connect it to any database.

Adding the User to the Database and Assigning Privileges

The 'Add User to Database' section is where the two pieces come together: selecting the user and the database from their respective dropdowns and clicking Add takes to a privileges screen. Selecting 'All Privileges' at the top checks every individual privilege box at once, which is the standard choice for an application like WordPress that needs full read, write, and table-management access.

For a more restricted setup — a reporting tool that should only read data, for instance — individual privileges (SELECT, INSERT, UPDATE, DELETE, and so on) can be checked selectively instead of granting everything, though most standard CMS or app installs expect and require full access to function correctly.

Gathering the Credentials an App Needs

Once created, an application's configuration typically asks for four things: the database host (almost always localhost on shared and most managed environments), the full prefixed database name, the full prefixed username, and the password set when the user was created. Missing or mistyping any one of these four is the most common cause of a 'database connection error' during a fresh install.

phpMyAdmin, accessible from cPanel, is where the database's actual tables and rows can be inspected directly once an application has been installed and started writing data to it — useful for confirming an install worked, or for manually adjusting a setting stored in the database when there's no other way to reach it.

How to Create a MySQL Database in cPanel

Database Tools Built for Real Applications

Hosting Cheap's cPanel-style panel includes the full MySQL Databases toolset plus phpMyAdmin, so setting up a database for WordPress, WooCommerce, or a custom app takes a few clicks rather than command-line work.

Databases created on the account are covered by the same daily backup routine as the rest of the site, so a bad query or accidental table drop doesn't have to mean starting over.

  • MySQL Database Wizard and direct MySQL Databases tool
  • phpMyAdmin included for direct table and row access
  • Daily backups covering databases alongside files
  • 24/7 human support for connection and privilege issues

Why Hosting Cheap

What you get

MySQL Database Wizard

Create a database, user, and privileges in one guided flow instead of separate tools.

phpMyAdmin Included

Inspect and edit tables directly whenever an app's own interface can't reach a setting.

Daily Backups

Databases are backed up daily alongside files, covering accidental data loss.

Pure NVMe SSD + LiteSpeed

Database queries run fast on NVMe-backed storage instead of spinning disks.

1-Click Installers

Popular apps can create their own database automatically during installation.

24/7 Human Support

Get help if a connection error points to a privilege or credential mismatch.

How It Works

Get set up in a few steps

1

Create the database

Enter a name in MySQL Databases and click Create Database.

2

Create a user and password

Add a new MySQL user with a strong, generated password.

3

Add the user to the database with privileges

Link the user to the database and grant All Privileges for full app access.

Included

Everything you need, on every plan

  • Database created with a clear, descriptive name
  • Separate database user created with a strong generated password
  • User added to the database, not just created in isolation
  • All Privileges granted for standard app installs like WordPress
  • Full prefixed database name and username noted exactly as shown in cPanel
  • Host value confirmed (usually localhost) for the app's configuration
  • Credentials stored securely rather than left in an unsecured note
  • Test connection confirmed after entering credentials into the app

FAQ

Frequently asked questions

Why is my database name longer than what I typed?

cPanel automatically prefixes every database and username with the account's cPanel username followed by an underscore. The full prefixed name, not the short version typed into the form, is what an app must use to connect.

Do I need to create a user separately from the database?

Yes. Creating a database on its own gives it no user with access. A separate user must be created and then explicitly added to that database with privileges before anything can connect.

What privileges does WordPress need?

WordPress and most standard CMS platforms expect All Privileges on their database, since they create, alter, and drop tables as part of normal operation, not just read and write rows.

What database host should I use in my app's config?

On shared and most managed hosting, the database host is almost always localhost, since the database server runs on the same machine as the web server.

Can I manage database rows directly without the app's interface?

Yes, phpMyAdmin (available from cPanel) provides direct access to tables and rows, useful for confirming data or fixing a setting an app's own admin panel doesn't expose.

What causes a database connection error right after install?

The most common causes are a mistyped database name, username, or password, or using the short name typed into the form instead of the full cPanel-prefixed version the app actually needs.

Set Up Your Database in Minutes

cPanel's MySQL tools, phpMyAdmin, and daily backups come standard on every Hosting Cheap plan.

Get Started