To back up a whole database or a single table, open phpMyAdmin, select the item, and use the Export tab. The file is saved to your computer as a .sql file. This article covers cPanel and DirectAdmin.
Before you start
You need to be able to log in to phpMyAdmin. Open phpMyAdmin from your control panel:
- cPanel: log in to cPanel and click phpMyAdmin under Databases.
- DirectAdmin: go to MySQL Management and click phpMyAdmin next to your database. The menu names can differ between DirectAdmin versions, so check your account if you cannot find them.
If you are not sure which control panel your plan uses, check your welcome email or the client area at https://my.hostking.host.
Export a whole database
cPanel
- In the left-hand panel, click the database you want to export.
- In the top menu, click Export.
- Leave the method on Quick and the format on SQL.
- Click Go.
- Save the file when your browser asks.
DirectAdmin
- In phpMyAdmin, click the database you want to export in the left-hand panel.
- Click the Export tab.
- Leave the method on Quick and the format on SQL.
- Click Go.
- Save the file when your browser asks.
The downloaded .sql file contains every table in the database.
Export a single table
- In the left-hand panel, click the database to expand it.
- Click the table you want to export.
- Click the Export tab.
- Leave the method on Quick and the format on SQL.
- Click Go, then save the file when your browser asks.
Custom export options
Use the Custom method to choose specific tables or change individual options.
- Structure only: under Format-specific options, untick Data and leave Structure ticked.
- Overwrite on import: under Object creation options, tick Add DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT / TRIGGER statement.
- Import compatibility: untick Add CREATE PROCEDURE / FUNCTION / EVENT statement if the database will be imported by a MySQL user who cannot create databases. Otherwise the import may fail.
- Compressed file: choose zipped (or another option) from the Compression drop-down menu.
Troubleshooting
The export fails or times out on a large database. phpMyAdmin is not designed for very large exports. Try exporting fewer tables at a time using the Custom method. If it still fails, contact support. Live chat and support tickets are available from the client area.
The page is blank or you cannot log in. Clear your browser cache, or try a private (incognito) window.
You exported the wrong database. Check the database name in your site's configuration file first. For WordPress, this is the wp-config.php file. Then export that database only.
Your disk is full. Check your available space in the client area before you start a large export.
