Creating and managing MySQL databases in cPanel
Create MySQL or MariaDB databases and users in cPanel, assign privileges, connect applications, manage character sets, and import/export data with phpMyAdmin.
On this page
Most dynamic web applications, including WordPress, Joomla, Magento, and custom PHP apps, require a MySQL or MariaDB database. cPanel makes it easy to create databases, create users, assign permissions, and import or export data.
Create a database and user
- In cPanel, go to Databases -> MySQL Databases. You can also use MySQL Database Wizard for a guided workflow.
- Under Create New Database, enter a name and click Create Database.
- Under MySQL Users, create a user with a strong unique password.
- Under Add User to Database, select the user and database, then click Add.
- Choose the privileges the application needs. For most CMS installations, select All Privileges.
cPanel adds your account username as a prefix to database names and database users. Use the full names, such as username_dbname and username_dbuser, in your application configuration.
Connect your application
| Setting | Value |
|---|---|
| Database host | localhost for same-server cPanel applications |
| Database name | The full prefixed database name |
| Database user | The full prefixed database username |
| Password | The password you set for the database user |
| Port | 3306 unless your application specifically says otherwise |
Character sets and collations
For modern websites, use utf8mb4 when possible. It supports full Unicode, including emoji and multilingual content. A common modern collation is utf8mb4_unicode_ci or the default collation selected by your MySQL/MariaDB version.
You normally do not need to change character sets manually for WordPress or modern installers. If you are importing an older database and see garbled characters, review the export encoding and see database character set troubleshooting.
Using phpMyAdmin
phpMyAdmin is a graphical interface for browsing tables, running SQL queries, importing database dumps, exporting backups, and repairing or optimizing tables. Open it from Databases -> phpMyAdmin.
Import and export
Export: In phpMyAdmin, select your database, click Export, choose Quick for a standard SQL backup, and download the file.
Import: Select the target database, click Import, choose your .sql or .sql.gz file, and click Go. Large files may need support assistance on shared hosting or command-line import on VPS/dedicated servers.
Troubleshooting
| Issue | What to check |
|---|---|
| Error establishing a database connection | Confirm database name, user, password, host, and user privileges. |
| Access denied for user | Reset the database user password and make sure the user is added to the correct database. |
| Garbled characters after import | Check source export encoding and database character set/collation. |
| Import too large | Compress the SQL file, split it, or contact support for shared-hosting imports. |
Related: Using phpMyAdmin in cPanel-import, export, and manage databases | Database backup and restore-quick reference | UTF-8 character encoding-store international characters correctly | Fix the WordPress white screen of death | Error establishing a database connection-diagnosis and fix
Need cPanel hosting or licensing?
Use UnderHost cPanel hosting or add cPanel/WHM to a VPS or dedicated server for familiar website, email, DNS, and database management.





















