How to Create and Manage MySQL Databases in cPanel Print

  • 0

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

  1. Login to cPanel → Databases → MySQL Databases.
  2. Under Create New Database, enter a name → click Create Database.
  3. Under Add New User, create a username & password → click Create User.
  4. 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

  1. Go to Databases → phpMyAdmin.
  2. Select your database from the left menu.
  3. Click Import → choose your .sql file → click Go.
  4. 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)

  1. Select the database in phpMyAdmin.
  2. Click Export.
  3. 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 name
  • DB_USER — database user
  • DB_PASSWORD — password
  • DB_HOST — usually localhost

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

Was this answer helpful?

« Back