phpMyAdmin is a web application for managing MySQL/MariaDB databases. It's available in every cPanel account and lets you work with a database without knowing SQL commands.
Opening phpMyAdmin
cPanel → Databases → phpMyAdmin. The interface will open with your databases listed in the left panel.
Basic operations
Creating a database
It's better to create it via cPanel → MySQL Databases (this also creates the user and assigns privileges). You can also do it in phpMyAdmin: left panel → "New" → enter a name → "Create".
Importing a database
1. Select the database in the left panel
2. Open the "Import" tab
3. Click "Browse" and pick the .sql file
4. Click "Go"
Maximum file size: usually 50–512 MB
For bigger files use SSH:
mysql -u user -p dbname < backup.sql
Exporting a database
1. Select the database → "Export" tab
2. Method: Quick or Custom
3. Format: SQL
4. Click "Go"
Running an SQL query
-- Select the DB → "SQL" tab
-- Examples:
SELECT * FROM wp_users LIMIT 10;
UPDATE wp_options SET option_value='https://example.com'
WHERE option_name='siteurl';
ALTER TABLE wp_posts ADD INDEX (post_status, post_type);
Useful operations for WordPress
| Task | SQL |
|---|---|
| Reset the admin password | UPDATE wp_users SET user_pass=MD5('newpass') WHERE user_login='admin' |
| Change the site URL | UPDATE wp_options SET option_value='https://new.com' WHERE option_name IN ('siteurl','home') |
| Delete spam comments | DELETE FROM wp_comments WHERE comment_approved='spam' |
Common phpMyAdmin Errors
#1045 Cannot log in to the MySQL server
#2006 MySQL server has gone away
File exceeds the maximum size (upload_max_filesize)
#1698 Access denied for user 'root'@'localhost'
| Message | Cause | Fix |
|---|---|---|
| #1045 Cannot log in to the MySQL server | Wrong database username/password in the access configuration | Check the credentials in cPanel → MySQL Databases, reset the user's password if needed |
| #2006 MySQL server has gone away | Importing a large dump exceeded max_allowed_packet or the query execution time | Import via SSH instead: mysql -u user -p dbname < backup.sql instead of the web interface |
| File exceeds the maximum size (upload_max_filesize) | The dump is larger than the upload limit set in php.ini for phpMyAdmin | Compress the file into a .zip before uploading, or import via SSH without the web form's limits |
| #1698 Access denied for user 'root'@'localhost' | On Ubuntu/Debian, MySQL root authenticates via auth_socket by default, not by password | Log in to phpMyAdmin as a separate database user with a password created in cPanel, not as root |
phpMyAdmin vs. SSH and mysqldump: When to Use Which
| Task | phpMyAdmin | SSH + mysqldump/mysql |
|---|---|---|
| A one-off simple query or row edit | Fast, visual, no SSH needed | Overkill for a small edit |
| Importing/exporting a database over 100 MB | Often hits PHP limits and timeouts | Works without web server restrictions |
| Regular automated backups | Not built for scheduling | Easy to set up in cron |
| Bulk editing table structure | Convenient visual editor | Requires manual ALTER TABLE statements |
When phpMyAdmin Doesn't Fit
- The database is gigabytes in size — the web interface runs into PHP limits (upload_max_filesize, max_execution_time) and browser timeouts
- You need regular automated operations — scheduled backups, deploy-time migrations — that's a job for SSH and backups, not a manual interface
- You're working with a database that cPanel can't reach (an external MySQL server not integrated with the panel) — a direct client like DBeaver or an SSH tunnel is simpler then
- You need transactional operations with a deliberate rollback on error — running SQL through a web form is less predictable than a script with an explicit BEGIN/COMMIT
Verifying the Result
# Compare the row count in a table before and after the operation
mysql -u user -p dbname -e "SELECT COUNT(*) FROM wp_posts;"
# Check that the dump actually imported without being cut off
tail -5 backup.sql
mysql -u user -p dbname -e "SHOW TABLES;" | wc -l
- After an import, compare the table count and the row count in key tables against what you expected — an import cut off by a limit often fails silently, without a clear error
- Open the site that uses this database and make sure it doesn't show a connection error or empty data
- After editing via the SQL tab, run the same SELECT again to confirm the change actually applied, rather than being stuck in a page cache
- For an export, open the .sql file in a text editor and check that it ends cleanly rather than breaking off in the middle of an INSERT
Resetting the MySQL password directly from the console when phpMyAdmin access is lost is covered in resetting the MySQL root password. Working with site files alongside the database is covered in the cPanel file manager.