Docs Home Return to Homepage
Get Started Login

How to Create a MySQL Database and User in cPanel

Last updated Changelog

On this page

Most websites and apps (WordPress, shops, forums) store their content in a MySQL database. You’ll need three things: a database, a database user with a password, and permission for that user to use the database. cPanel’s Database Wizard walks you through all three.

Tip: Installing WordPress or another app with Softaculous? It creates the database for you, so you can skip this guide. See Install WordPress.

Steps

  1. Log in to cPanel. In the Databases section, click Database Wizard.

    The cPanel Databases section with Database Wizard highlighted

  2. Step 1: type a name for the database and click Next Step. cPanel adds your account name at the front, so shop becomes cranedemo_shop.

    Step 1 of the Database Wizard with shop entered as the database name

  3. Step 2: choose a Username (again, your account name is added at the front) and a strong Password, twice. Password Generator can make one for you. Note the password down, then click Create User.

    Step 2 with the username shop, both password boxes and Create User highlighted

  4. Step 3: tick ALL PRIVILEGES, which ticks every box below it. Then scroll down and click Next Step.

    Step 3 with ALL PRIVILEGES ticked

  5. Step 4: cPanel confirms the user was added to the database. You’re done.

    Step 4 confirming cranedemo_shop was added to the database cranedemo_shop

Connecting your app

Most apps ask for these four details:

Setting What to enter
Database name The full name with prefix, such as cranedemo_shop
Username The full username with prefix, such as cranedemo_shop
Password The password you set in step 3
Host localhost (for apps on your NameCrane hosting)

Troubleshooting

Problem What to do
“Access denied for user” Check you’re using the full username and database name, including the prefix. Make sure the user was added to the database with privileges, under Manage My Databases.
I forgot the database password In Manage My Databases, find the user under Current Users and click Change Password, then update your app’s settings.
I need to connect from my own computer Your IP address must be allowed first. See Remote database access.

Snagged on something? Contact support and we’ll get you sorted.

Snagged on something?

Our sysadmins answer tickets around the clock.