Knowledgebase article

How to create a MySQL database and user in cPanel

A database is where your website keeps its memories: posts, products, orders and user accounts. WordPress, Joomla, PrestaShop and most other web applications need one. Here's how to make one in cPanel, with its own user and password.

The quick way: Database Wizard

  1. Log in to cPanel and go to Databases > Database Wizard.
  2. Step 1: type a name for your database and click Next Step.
  3. Step 2: type a username, set a strong password (or use Password Generator) and click Create User.
  4. Step 3: tick ALL PRIVILEGES and click Next Step.
  5. Done! Romeo shows you a happy summary.

The manual way: Manage My Databases

1. Create the database

  1. Go to Databases > Manage My Databases.
  2. Under Create New Database, type a name after the prefix (for example shop).
  3. Click Create Database, then Go Back.

2. Create a database user

  1. Scroll down to Database Users > Add New User.
  2. Enter a Username, a Password twice (watch the Strength meter; aim for green).
  3. Click Create User, then Go Back.

3. Introduce them to each other

A database and a user are strangers until you introduce them:

  1. Under Add User To Database, choose your User and Database.
  2. Click Add.
  3. Tick ALL PRIVILEGES and click Make Changes.

Why does my database name have a prefix?

cPanel always adds your cPanel username in front, like abcd1234_shop. Use the full name (with prefix) in your website's configuration, for both the database and the user.

What to put in your website's settings

Setting Value
Database host localhost
Database name cpaneluser_shop (full name)
Username cpaneluser_shopuser (full name)
Password the one you set

Romeo's tip: Installing WordPress with Softaculous? It creates the database for you, so you can skip all of this.

Was this answer helpful?

Related articles

Still stuck? Romeo's got you.
Our support team replies around the clock, real humans who know your server.