Backing up your database is essential before making changes to your website, updating plugins, or migrating to a new server. Ultra Web Hosting gives you several ways to create database backups, from a quick download in phpMyAdmin to automated cron-based backups.
phpMyAdmin Export - 30 seconds
Log into cPanel > phpMyAdmin, select your database, click "Export," choose "Quick," and click "Go." A .sql file downloads to your computer. Done.
01. Backup via phpMyAdmin
- Log into cPanel and open phpMyAdmin (under Databases)
- Select your database from the left sidebar
- Click the "Export" tab
- Select "Quick" for default settings (exports all tables as SQL)
- Click "Go" to download the
.sqlfile
For larger databases or specific needs, choose "Custom" export which lets you select specific tables, add DROP TABLE statements (useful for clean restores), compress the output as gzip or zip, and choose the SQL compatibility mode.
When using Custom export, check "Add DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT / TRIGGER statement." This makes the backup file self-contained: when you import it later, it will drop existing tables first, preventing duplicate key errors.
02. Backup via cPanel Backup Tool
- Log into cPanel
- Go to Files > Backup (or "Backup Wizard" for a guided process)
- Under "Download a MySQL Database Backup", click the name of the database you want to download
- The compressed
.sql.gzfile downloads to your computer
This is the same data as a phpMyAdmin export but compressed, which is faster for large databases. The cPanel backup tool also lets you download a full account backup (files + databases + email) in one shot. See How to Back Up Your Website for the full backup guide.
03. Backup via SSH (mysqldump)
If you have SSH access, mysqldump is the most powerful backup method:
mysqldump -u dbuser -p dbname > ~/backup_$(date +%Y%m%d).sql
Replace dbuser with your database username and dbname with the database name. You will be prompted for the password. The backup file is saved to your home directory with today's date in the filename.
To create a compressed backup:
mysqldump -u dbuser -p dbname | gzip > ~/backup_$(date +%Y%m%d).sql.gz
To find your database username and password, check your site's configuration file (e.g., wp-config.php for WordPress).
04. Automated Backups With Cron
You can set up a cron job to back up your database automatically on a schedule. See How to Create a Cron Job for setting up cron jobs in cPanel.
Example cron command that backs up daily and keeps the last 7 days:
mysqldump -u dbuser -p'yourpassword' dbname | gzip > ~/backups/db_$(date +\%Y\%m\%d).sql.gz && find ~/backups -name "db_*.sql.gz" -mtime +7 -delete
The cron example above includes the password in the command line, which is visible in process listings. For better security, store your credentials in a ~/.my.cnf file with permissions set to 600. Then mysqldump will read the credentials automatically without exposing them.
05. How to Restore a Backup
Via phpMyAdmin
- Select your database in phpMyAdmin
- Click the "Import" tab
- Click "Choose File" and select your
.sqlor.sql.gzfile - Click "Go"
Via SSH
mysql -u dbuser -p dbname < ~/backup_20260325.sql
For compressed backups:
gunzip < ~/backup_20260325.sql.gz | mysql -u dbuser -p dbname
Need Help With Database Backups?
If you need help creating or restoring a database backup, or if you need us to restore from a server-level backup, open a ticket.
Open a Support TicketQuick Recap
- phpMyAdmin - Fastest for one-off backups (Export tab > Quick > Go)
- cPanel Backup - Downloads compressed backups under Files > Backup
- mysqldump via SSH - Most flexible, scriptable for automation
- Automate with cron - Schedule daily backups and auto-delete old ones
- Always back up before making changes - Updates, migrations, and plugin installs
Protecting your data with regular backups · Last updated March 2026 · Browse all PHP/MySQL articles
