How to Manage MySQL Databases in cPanel
Create databases & users, import/export SQL files, and fix common database issues in cPanel.
Create a Database and User
- Login to cPanel → Databases → MySQL Databases.
- Under Create New Database, enter a name → click Create Database.
- Under Add New User, create a username & password → click Create User.
- Under Add User to Database, select the user + DB → click Add → choose All Privileges.
Note: Your database names include your cPanel prefix (Example:
user_dbname).
Import a Database Using phpMyAdmin
- Go to Databases → phpMyAdmin.
- Select your database from the left menu.
- Click Import → choose your
.sqlfile → click Go. - Wait for the success message.
Warning: Very large SQL files may fail in phpMyAdmin. Import tables individually or use your host’s restore system.
Export a Database (phpMyAdmin)
- Select the database in phpMyAdmin.
- Click Export.
- Choose Quick → SQL → click Go to download.
Update CMS Configuration
Open your CMS configuration file (such as wp-config.php) and update:
DB_NAME— database nameDB_USER— database userDB_PASSWORD— passwordDB_HOST— usuallylocalhost
Common Database Errors & Fixes
“Error establishing a database connection”
- Check DB name, user, password in config file.
- Ensure user has privileges in MySQL Databases.
phpMyAdmin import errors
- Split large SQL files.
- Import tables one by one.
- Check SQL encoding or syntax using a text editor.
Checklist
- [ ] Create database - [ ] Create user & assign privileges - [ ] Export old DB / import into new - [ ] Update CMS config credentials - [ ] Test database-driven pages© cPanel Database Guide