cPanel Hosting

phpMyAdmin and MySQL Databases in cPanel

Working with databases in cPanel — creating, importing, exporting, optimizing — and the common WordPress database tasks where phpMyAdmin saves you.

5 min read

Most of the time you’ll never touch your database directly — WordPress, your CMS, or your app handles all the SQL for you. But once or twice a year, you’ll need phpMyAdmin: fixing a corrupted setting, importing a database after a migration, running a one-off cleanup query, or recovering a forgotten admin password. This guide covers the database tasks that come up in practice.

Creating a database

cPanel → Databases → MySQL Databases. Two steps:

  1. Create the database. Top of the page — enter a name (gets prefixed with your cPanel username, e.g. youruser_wpsite). Click Create Database.
  2. Create a user. Scroll to “Add New User” — pick a username, generate a strong password (use the password generator). Click Create User.
  3. Link them. Scroll to “Add User To Database”. Select your user and your database, click Add. On the privileges page, check ALL PRIVILEGES for standard app usage, click Make Changes.

Save the database name, username, and password to your password manager. You’ll need all three when configuring WordPress (or any app) to use it.

Opening phpMyAdmin

cPanel → Databases → phpMyAdmin. Single click — you’re logged in via cPanel SSO, no separate credentials. The left sidebar lists every database your account owns; click any to expand its tables.

Top tabs you’ll use:

  • Structure — list of tables in the current database.
  • SQL — run raw SQL queries.
  • Export — download the database as a SQL file.
  • Import — upload a SQL file to restore.
  • Operations — rename database, change collation, drop database.

Exporting a database (backup)

  1. Click the database in the left sidebar.
  2. Click the Export tab at the top.
  3. Method: Quick for typical use, Custom if you want to exclude specific tables.
  4. Format: SQL.
  5. Click Go. The browser downloads a .sql file.

For very large databases (500+ MB), the browser export may timeout. In that case, use cPanel → JetBackup 5Database BackupsDownload instead — server-side export with no timeout.

Importing a database

  1. Create an empty target database first (see “Creating a database” above).
  2. Click the new database in phpMyAdmin sidebar.
  3. Click Import tab.
  4. Choose your .sql file. Format auto-detects.
  5. Click Go.

If the import file is over ~50 MB, you’ll hit phpMyAdmin’s upload limit. Workarounds:

  • Compress the SQL to .gz first — phpMyAdmin handles compressed imports natively, and the file size drops dramatically.
  • Upload to your home directory via File Manager, then use SSH/cron to run mysql -u user -p database < file.sql.
  • Use JetBackup’s restore feature for a full database.

Common WordPress database tasks

Reset your WordPress admin password

When you can’t log in and the email password reset isn’t working:

  1. Open phpMyAdmin, click your WordPress database.
  2. Click the wp_users table (or whatever prefix you used — could be iwv_users).
  3. Find your user, click Edit.
  4. In the user_pass field, type a new password.
  5. From the Function dropdown next to it, select MD5.
  6. Click Go at the bottom.

WordPress will accept the MD5 hash for one login, then re-hash it to its newer bcrypt format on the next save.

Change your WordPress site URL

Useful after a domain change or migration where you can’t access WP admin:

  1. Open the wp_options table.
  2. Find the siteurl row → Edit → change to https://newdomain.com → Go.
  3. Find the home row → Edit → change to same value → Go.

This only changes WordPress’s URLs — content URLs embedded in posts (image src, internal links) still reference the old domain. For a full URL change use a search-replace plugin AFTER restoring access.

Disable all plugins (when site is white-screening)

When a plugin update breaks your admin and you can’t log in:

  1. Open wp_options.
  2. Find the active_plugins row → Edit.
  3. Change option_value to: a:0:{}
  4. Go.

All plugins are deactivated. Site comes back, you log in, then re-enable plugins one at a time to find the culprit.

Switch to a default theme (when current theme is broken)

  1. Open wp_options.
  2. Find template and stylesheet rows.
  3. Change both values to a known-installed default theme like twentytwentythree or twentytwentyfour.

Optimizing tables

Over time, tables accumulate “overhead” — wasted space from deleted/updated rows. Periodically optimize them:

  1. Click your database.
  2. Click Check All at the bottom of the table list.
  3. From the dropdown, choose Optimize table.
  4. Click. phpMyAdmin runs OPTIMIZE TABLE on each.

Speeds up queries slightly, reclaims disk. Worth running quarterly or after large data deletions.

Common database issues

“Error establishing a database connection” in WordPress. Credentials in wp-config.php don’t match. Double-check name (with prefix), user, password. Verify the user has been added to the database in MySQL Databases.

“Access denied for user”. User exists but isn’t linked to the database. Go to MySQL Databases → Add User to Database → confirm “All Privileges” is checked.

Database is huge and slowing the site. Find the largest tables: phpMyAdmin → click database → scroll to bottom to see total size, sort by size. Common bloat: wp_options (rogue transients), wp_postmeta (orphaned meta from deleted posts), spam/revision-laden wp_posts. Plugins like WP-Optimize or WP-Sweep clean these up safely.

Migrated database but site has the old domain in URLs. Use Search-Replace plugin (or the standalone wp-cli search-replace command, or interconnectit’s Search-Replace tool). Never use phpMyAdmin’s Find and Replace for serialized data — it corrupts it. Use a real WordPress-aware search-replace tool.

Import fails with timeout. File too large. Gzip the SQL or import via SSH.

What’s next

Always back up before editing — it’s a 30-second JetBackup snapshot. The number-one cause of “now I’ve made it worse” is editing the database with no fallback. Backup first; experiment second.

Was this helpful?