# How to create a MySQL database and user in cPanel

URL: https://shrotihost.in/help/create-mysql-database-cpanel
Topic: Files and databases. Steps last checked: 2026-11-22. By the Shroti Host team.

> You create databases in cPanel under MySQL Databases and browse them in phpMyAdmin. A working database needs three things: the database, a user, and the user added to the database with privileges. We do not offer PostgreSQL on any plan.

## Before you start

All shared, WordPress and unlimited hosting plans.

## Steps

1. In cPanel open MySQL Databases and create the database.
2. On the same page, create a user with a strong password. Note the password now: cPanel does not show it again.
3. Add the user to the database on the same page, and grant All Privileges.
4. In your application's config, use localhost as the host, with the full database name and user name exactly as cPanel shows them. Both carry your account name as a prefix.
5. To look inside a database, or to import or export a .sql file, open phpMyAdmin in cPanel, select the database on the left, and use the Import or Export tab.

## How to tell it worked

MySQL Databases lists the database with the user attached to it, and your application connects without a database error.

## If it did not work

- Access denied: the user is not attached to that database, or the name is missing your account prefix.
- WordPress shows 'Error establishing a database connection': compare DB_NAME, DB_USER and DB_PASSWORD in wp-config.php with what MySQL Databases shows, and keep DB_HOST as localhost.
- A large import stops partway: it is usually over the upload limit. Compress the .sql file and try again.

## When to contact support

For an import that is still too large, upload the file with File Manager and [open a ticket](https://portal.shrotihost.in/submitticket.php) asking us to import it from the server side. Tell us the file name and the database.

Related product: [Shared hosting](https://shrotihost.in/hosting). MySQL databases and phpMyAdmin are included on every tier.

## Related

- [Upload files with File Manager or FTP](https://shrotihost.in/help/upload-files-file-manager-ftp)
- [Install WordPress in cPanel](https://shrotihost.in/help/install-wordpress-cpanel)
- [Migrate your website to Shroti Host](https://shrotihost.in/help/migrate-website-to-shroti-host)
