Skip to content
P. O. Box 6084 - 00100, Nairobi, Kenya Customer Login
Hosting Setup Guides

How to Import and Export a Database With phpMyAdmin

phpMyAdmin is the database tool inside cPanel. You will use it to back up a database before big changes, to move a website from another host, or to restore data. This guide covers exporting and importing step by step — including what to do when files are too large.

Time needed5–15 minutes
DifficultyIntermediate
You needcPanel login and the database name
WherecPanel → Databases → phpMyAdmin

Before you start

  • Know which database your site uses. For WordPress, open wp-config.php in File Manager and look for DB_NAME. For other software, check its config file (often .env or config.php).
  • Export before every import. Importing can overwrite tables. Always download a copy of the current database first.

Part A: Export (download) a database

Step 1: Open phpMyAdmin

In cPanel, go to Databases → phpMyAdmin. It opens in a new tab — no extra login needed.

Step 2: Select the database

In the left column, click the database name (for example yourbusi_wp). Its tables appear on the right.

Click your database in the left list (1), then the Export tab (2).
Figure 1 Click your database in the left list (1), then the Export tab (2).

Step 3: Export as SQL

  1. Click the Export tab.
  2. Export method: Quick is fine for most sites. Choose Custom if you want compression.
  3. Format: SQL.
  4. Click Go. A file like yourbusi_wp.sql downloads to your computer.
Choose Quick (1), keep SQL format (2) and click Go (3) to download the .sql file.
Figure 2 Choose Quick (1), keep SQL format (2) and click Go (3) to download the .sql file.
Tip

For big databases (over 50 MB), choose Custom → Compression: zipped or gzipped. The download is much smaller and phpMyAdmin can import it directly.

Part B: Import a .sql file

Step 1: Make sure the target database exists

Importing goes into an existing database. If you are moving a site, create an empty database and user first — see Create a MySQL database.

Important

If the target database already has tables with the same names, the import may replace them. Export a backup of the target first (Part A).

Step 2: Select the database and open Import

In phpMyAdmin, click the target database in the left column, then the Import tab.

Step 3: Choose the file and import

  1. Click Choose File / Browse and pick your .sql, .sql.gz or .zip file.
  2. Character set of the file: utf-8 (default).
  3. Leave Partial import and other options at their defaults.
  4. Format: SQL.
  5. Click Import (or Go) at the bottom.
Choose the file (1), keep SQL format (2), click Import (3) and wait for the green success message (4).
Figure 3 Choose the file (1), keep SQL format (2), click Import (3) and wait for the green success message (4).

When the green message appears, click the database name again and check the tables are listed.

Large files (over the upload limit)

The maximum import size is shown under the file box. If your file is larger:

  1. Compress it (.gz or .zip) — SQL text compresses 5–10×.
  2. Raise the limit: Software → Select PHP Version → Options, increase upload_max_filesize and post_max_size (e.g. 256M) — see Change PHP settings.
  3. Still too big? Upload the file to your home folder with FTP and ask our support team to import it for you — we do this free.

After importing a website's database

  • Update the website's configuration with the new database name, user and password (wp-config.php, .env).
  • If the domain changed, update URLs inside WordPress — see Move WordPress to a new domain.

Troubleshooting

Error Cause Fix
#1044 Access denied for user … to database 'olddb' The file contains CREATE DATABASE / USE olddb lines from the old host Open the file in a text editor and delete those lines near the top, or re-export without “Add CREATE DATABASE”
#1062 Duplicate entry Importing into a database that already has data Import into an empty database, or drop the existing tables first (after backing up)
#1273 Unknown collation 'utf8mb4_0900_ai_ci' Export came from MySQL 8 Replace utf8mb4_0900_ai_ci with utf8mb4_unicode_ci in the file, then import
“You probably tried to upload a file that is too large” Over the size limit Compress, raise PHP limits, or ask support
Import stops / times out Very large file on a slow connection Use compressed file; ask support for a server-side import
Strange characters (é, ’) after import Wrong character set Re-import with utf-8; make sure the export was utf8mb4

Frequently asked questions

Is phpMyAdmin export a full website backup? No — it only covers the database. You also need your files (public_html). For a complete backup see Backup Wizard.

Can I export just one table? Yes. Click the table, then Export.

Tags:phpmyadminmysqldatabasebackupmigration

Figures are simplified illustrations. Your screen may look slightly different depending on your theme and the version of cPanel or the app you use.

Still need help?

Our Kenyan support team is on WhatsApp — real people, not bots. Mon–Sat, 8am–10pm EAT. Tickets are open 24/7.

Related guides

All Articles