A secure home for your next big idea. Explore hosting →

Knowledgebase / cPanel and Backups

How to Create a MySQL Database and User in cPanel

Create a database, a dedicated user and the correct assignment, then connect your application using the complete account-specific values.

Prerequisites

Sign in to the correct cPanel account and confirm that its plan allows another database. Have the application’s installation requirements available, including supported database engine and version. Interface names may say Database Wizard, MySQL Database Wizard or Manage My Databases depending on the server version.

Decide whether this is a new application or a migration. A new empty database is appropriate for a fresh installation. A migration also needs an approved export and import process; creating the destination alone does not copy existing content.

Step 1: Create the database

  1. Open the database wizard if available.
  2. Enter a short descriptive database name for this application.
  3. Continue and record the complete generated name, including any account prefix.
  4. If a quota or name error appears, resolve it before continuing. Do not delete another database to make space without identifying its owner and taking a backup.

For example, a panel may add an account prefix to the name you enter. Treat that as an illustration of naming behavior, not a credential to copy. Applications need the exact final value displayed by your own panel.

Step 2: Create a dedicated database user

Create a separate user for the application and generate a strong unique password. Store it in an approved password manager. Keep database credentials distinct from the cPanel login and from customer-facing application accounts.

Record the full username. A database and a user are separate objects, even when their names look similar. Creating both objects does not necessarily finish the assignment step. Sharing one user across many unrelated applications makes later rotation and incident recovery harder.

Step 3: Assign the necessary privileges

Complete the wizard’s assignment screen for this specific database. Grant the privileges required by the application’s documented installer. Some installers require broad privileges within their own database for schema creation and upgrades. This does not justify global privileges or access to every database in the hosting account.

If you use the separate management screen instead of the wizard, explicitly add the user to the database and save its privileges. Reopen the assignment to confirm it persisted. Avoid editing cPanel-managed users directly through ad hoc administrative SQL.

Step 4: Connect and verify

Enter the database name, user, password and provider-supplied database host in the application’s private configuration screen. Do not assume that a database host is the website domain or a server IP found in a generic guide.

Run the application’s connection check or installation step. For a new installation, confirm that its expected tables appear and that a test login works. For a migration, import and verify the approved data before pointing production traffic at the application.

Troubleshooting

An access-denied error calls for checking the full username, password and assignment. An unknown-database error calls for checking the complete database name. A connection-refused or timeout error may involve the host, service or network and needs provider investigation.

If creation succeeds but imports fail, inspect quota, upload limits and database compatibility. Never delete the source data while resolving an import error. Success means the application can use only its intended database and its required operations complete without privilege errors.

Frequently asked questions

Can I use my cPanel password?

Create a separate database-user password; do not reuse your hosting login.

Why is a prefix added?

Some hosting configurations prefix names to keep accounts distinct. Use the full displayed name.

Does the wizard move my old data?

No. Data migration is a separate export, import and verification process.

Related guides and hosting options

Compare shared hosting against your application requirements. Confirm available tools and management responsibilities for your own account. For account-specific help, open a private support ticket with the domain, time and relevant redacted error.

Official references