SYSTEMS OPERATIONAL
Hosting

Managing MySQL Databases in cPanel with phpMyAdmin

Getwebup 5 min read

Most WordPress and PHP apps need a MySQL database somewhere behind the scenes, and cPanel gives you two tools to manage it: the MySQL Database Wizard for setup, and phpMyAdmin for the day-to-day work. If you've never touched either, or you're stuck on an import error at 2 a.m., here's how the whole thing actually fits together.

How cPanel databases actually work

cPanel doesn't let you create a database and just start using it. There are three separate pieces, and skipping one is the most common reason things don't connect:

  • A database - the empty container for your tables (e.g. username_wp).
  • A database user - a login with a password, separate from your cPanel login (e.g. username_wpuser).
  • A privilege grant - the step that links the user to the database and decides what they're allowed to do.

cPanel automatically prefixes both database and user names with your cPanel username, so wp becomes myaccount_wp. That's not optional - it's how shared hosting keeps every customer's databases separate on the same MySQL server.

Creating a database and user (MySQL Database Wizard)

  1. In cPanel, go to Databases > MySQL Database Wizard.
  2. Step 1: enter a name (e.g. wp) and click Next Step.
  3. Step 2: create a user - use the password generator, don't reuse an old password, and save it in a password manager immediately.
  4. Step 3: tick ALL PRIVILEGES unless you specifically need a read-only or limited-access user, then click Next Step.

Write down the full database name, full username, password, and host (almost always localhost on shared hosting). Your app's config file - wp-config.php for WordPress, .env for Laravel, configuration.php for Joomla - needs all four values exactly as cPanel created them.

Opening and navigating phpMyAdmin

From cPanel, go to Databases > phpMyAdmin. It logs you in automatically as root for your account, so you'll see every database you own in the left sidebar. Click a database name to expand its tables, then click a table to browse, filter, or edit rows directly through the Browse and SQL tabs.

A few tabs worth knowing:

  • Structure - see and edit columns, indexes, and table engine (usually InnoDB).
  • SQL - run raw queries. Useful for quick fixes like updating a site URL: UPDATE wp_options SET option_value='https://example.com' WHERE option_name='siteurl';
  • Export / Import - covered below, and where most support tickets come from.

Symptom: "#1045 Cannot log in to the MySQL server"

Cause: the username, password, or host in your app's config doesn't match what cPanel actually created - usually because the account prefix was left off, or the password has special characters that got mangled when pasted.

Fix:

  1. In cPanel, go to Databases > MySQL Databases and confirm the exact user and database names, including the prefix.
  2. Under Current Users, click Change Password for that user, generate a fresh one, and update it in your config file immediately.
  3. Scroll to Add User To Database and confirm the user is actually linked with ALL PRIVILEGES - it's easy to create a user and forget to grant it access to the database.
  4. Confirm the host value in your config is localhost, not an IP address or the domain name, unless your host explicitly told you otherwise.

Symptom: phpMyAdmin import fails or times out

Cause: the SQL file is bigger than phpMyAdmin's upload limit (commonly 50 MB on shared hosting), or the import runs past the PHP execution time limit and phpMyAdmin gives up mid-file.

Fix - for files under the limit: compress the .sql file to .zip or .gz before uploading. phpMyAdmin decompresses it automatically and the smaller upload usually clears the size check.

Fix - for larger databases: skip the browser entirely and import over SSH, which has no upload-size ceiling:

mysql -u username_wpuser -p username_wp < backup.sql

If you don't have SSH access on your plan, split the .sql file into smaller chunks (phpMyAdmin's own "partial import" checkbox on the Import tab lets you resume a large file in pieces instead of restarting from zero each time).

Symptom: export is missing tables or breaks on import elsewhere

Cause: the default "Quick" export method uses a template that can silently skip triggers, views, or stored routines depending on phpMyAdmin's version and settings.

Fix: on the Export tab, choose Custom instead of Quick, and confirm these are checked before you export:

  • Structure - with "Add DROP TABLE", so a re-import doesn't collide with existing tables.
  • Data
  • Under Structure options: triggers, views, and stored routines, if your app uses any.

For anything beyond a small site, export via SSH instead - it's faster and never times out:

mysqldump -u username_wpuser -p username_wp > backup.sql

Preventing database headaches

PracticeWhy it matters
Keep a plain-text record of DB name, user, host per siteSaves you from guessing prefixes during a migration or restore
Use ALL PRIVILEGES only for the app's own userLimits blast radius if one app gets compromised
Schedule regular exports separate from your host's automatic backupsGives you a fast, portable copy you control before making risky changes
Prefer SSH for anything over a few MBAvoids browser upload limits and execution timeouts entirely

If a database problem is tangled up with a WordPress-specific error message, that's usually a wp-config.php or MySQL service issue rather than a phpMyAdmin one - worth checking that angle separately if the steps above don't clear it.

Frequently asked questions

Why does cPanel add my username to every database and user name?

Shared MySQL servers host many customers' databases together, so cPanel prefixes every database and user with your account username to guarantee no two customers can ever collide on the same name.

Can I rename a MySQL database in cPanel?

Not directly - MySQL doesn't support renaming a database in place. In cPanel's MySQL Databases page, use the rename icon next to the database, which actually creates a new database with the new name, copies everything over, and drops the old one for you.

What's the maximum phpMyAdmin upload size on Getwebup hosting?

It depends on your plan's PHP upload_max_filesize and post_max_size values, commonly 50-100MB on shared hosting. For anything larger, import via SSH with the mysql command, which has no such limit.

Is it safe to run UPDATE or DELETE queries directly in phpMyAdmin's SQL tab?

Yes, but take a quick export of the affected table first. There's no undo once a query commits, and a missing WHERE clause on an UPDATE or DELETE can rewrite or wipe every row in the table.

My database user has ALL PRIVILEGES but I still get an access denied error - why?

Double-check the user is actually added to that specific database on the MySQL Databases page - creating a user and creating a database are separate steps, and a user with no explicit grant on a database can't log in to it even with a correct password.

#cpanel #phpmyadmin #mysql #database #hosting

Keep reading

Chat with Support