Most website software, including WordPress, Joomla and online shops, stores its content in a MySQL database. This guide shows how to create a MySQL database and user in cPanel, connect them, and find the details your website needs to use them. Your Instant Access Internet Services plan includes unlimited databases.
If you're installing WordPress, you don't need to do this: WP Toolkit creates the database for you automatically.
What you'll end up with
Every database needs three pieces that work together:
- A database, for example
username_shop. - A database user with a password, for example
username_shopuser. - The user added to the database with permission (privileges) to use it.
cPanel automatically puts your cPanel username and an underscore in front of every database and user name, so if you type shop, the full name becomes username_shop. Always use the full name in your website's settings.
The quick way: Database Wizard
The Database Wizard walks you through all three steps in order.
- Log in to cPanel and go to Databases > Database Wizard.
- Step 1: Type a name for the New Database and click Next Step.
- Step 2: Type a Username, then enter a Password twice or click Password Generator. Copy the password somewhere safe, then click Create User.
- Step 3: Tick ALL PRIVILEGES and click Next Step.
- Step 4: You'll see a confirmation that the user was added to the database. You're done.
Step by step with Manage My Databases
Use this method if you want to add an existing user to a new database, or manage several databases at once.
1. Create the database
- In cPanel, go to Databases > Manage My Databases.
- Under Create New Database, type a name in New Database.
- Click Create Database, then Go Back.
2. Create the database user
- On the same page, scroll to Add New User.
- Enter a Username and a strong Password (twice), or use Password Generator. Save the password somewhere safe; cPanel can't show it to you again later.
- Click Create User, then Go Back.
3. Add the user to the database
- Scroll to Add User To Database.
- Choose your new user from the User menu and your new database from the Database menu, then click Add.
- On the privileges page, tick ALL PRIVILEGES and click Make Changes.
Skipping this last step is the most common reason a new website can't connect to its database.
Database connection details for your website
When your software asks for database settings, use:
| Setting | Value |
|---|---|
| Database host / server | localhost |
| Database name | The full name, e.g. username_shop |
| Database username | The full name, e.g. username_shopuser |
| Password | The password you set for the database user |
| Port | 3306 (usually filled in automatically) |
The database password is not your cPanel password. It belongs only to the database user.
Common questions
How do I see what's in the database?
Go to Databases > phpMyAdmin and click the database name in the left-hand panel. You can browse tables, run queries, and import or export data there.
Can I connect to my database from my own computer?
Databases only accept connections from the server itself, and Remote MySQL isn't offered. To work on your database from a desktop app such as HeidiSQL, MySQL Workbench or TablePlus, connect through an SSH tunnel -- see How to Connect to Your Database from Your Computer with an SSH Tunnel. For quick jobs, phpMyAdmin in cPanel needs no setup at all.
I forgot the database user's password
cPanel can't show it, but you can set a new one. See the guide on changing a MySQL user's password below, and remember to update your website's config file afterwards.
How do I delete a database I no longer need?
In Manage My Databases, find it under Current Databases and click Delete. This permanently removes all its data, so export a copy first if you might need it. Make sure no website is still using it (check DB_NAME in wp-config.php for WordPress sites).
Related guides
- How to Import and Export a Database with phpMyAdmin
- How to Change a MySQL Database User's Password
- How to Fix "Error Establishing a Database Connection" in WordPress
- How to Install WordPress with WP Toolkit in cPanel
- How to Restore a MySQL Database with JetBackup 5
Still stuck? Open a support ticket and the Instant Access Internet Services team will help.
