EN · $ USD
Web Hosting and cPanel

How to Import and Export a Database with phpMyAdmin

7 min read Updated: Sunucu Atlas technical team

In short

To import a database in phpMyAdmin, select the target database in the left sidebar, upload your .sql or .sql.gz file on the Import tab and click Go. To export, choose the SQL format on the Export tab. If the file exceeds the upload limit, compress it, split it or import it from the terminal with the mysql command, and use utf8mb4 to keep special characters intact.

In this guide
  1. What is phpMyAdmin and where is it in cPanel?
  2. Exporting a database (taking a backup)
  3. Importing a database
  4. Getting past the upload limit for large SQL files
  5. Character set errors and utf8mb4
  6. Other common import errors
  7. Exporting a single table or query result
  8. Post-migration checklist
  9. Smooth migrations with the right hosting plan

Importing a database with phpMyAdmin comes down to selecting the target database, opening the Import tab and uploading a .sql file; exporting is a one-click job on the Export tab. Problems usually show up in two places: when the file is larger than the server's upload limit, and when the character set or collation does not match. This guide covers the basic process first, then permanent fixes for both problems.

What is phpMyAdmin and where is it in cPanel?

phpMyAdmin is an open-source web interface for managing MySQL and MariaDB databases in your browser. You can browse tables, run SQL queries, and download a database as a backup to load somewhere else. In cPanel, open it with the phpMyAdmin icon in the Databases section; it does not ask for a separate password and lists every database on your account in the left sidebar.

The target database must exist before you start an import. If you have not created it yet, complete the four steps in the guide to creating a MySQL database and user in cPanel.

Exporting a database (taking a backup)

  1. In phpMyAdmin, click the database you want to export in the left sidebar. Selecting the database first matters; otherwise the server-level export screen opens.
  2. Switch to the Export tab in the top menu.
  3. The Quick method and SQL format are enough in most cases. Click Go and the file downloads to your computer.

For more control, choose the Custom method and review these settings:

  • Compression: Choose gzipped. Text-based SQL files compress very well, which makes both downloading and re-uploading easier.
  • Add DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT / TRIGGER statement: Check this to overwrite tables that already exist on the target.
  • Add CREATE DATABASE / USE statement: Leave this unchecked on shared environments like cPanel. The database name will be different on the target server, so you will get a permission error during import.

Importing a database

  1. Select the target database in the left sidebar. If it already contains tables and you are replacing them completely, back it up first.
  2. Open the Import tab.
  3. Use Choose file to select your .sql, .sql.gz or .zip file. The value shown on the page as Max: X MiB is the upload limit the server allows.
  4. Leave Character set of the file set to utf-8.
  5. Keep the Partial import option that allows interrupting the import near the time limit checked; if a large file gets cut off, you can select the same file again and resume where it stopped.
  6. Click Go. On success, a green message box shows how many queries were executed.

Getting past the upload limit for large SQL files

The largest file phpMyAdmin can upload is capped by PHP's upload_max_filesize and post_max_size values, and max_execution_time also comes into play for long imports. If your file exceeds the limit, try the methods below in order.

1. Compress the file

This is the simplest fix. If you did not choose gzip when exporting, compress the file on your computer as .gz or .zip. phpMyAdmin accepts compressed files directly, and the limit applies to the compressed size.

2. Raise the PHP limits

With MultiPHP INI Editor in cPanel, you can increase upload_max_filesize, post_max_size and max_execution_time. post_max_size must be greater than or equal to upload_max_filesize. For a detailed walkthrough, see the guide to changing PHP settings in cPanel.

3. Move tables in batches

When exporting with the Custom method, select only certain tables and create several separate files. In WordPress, for example, log and session tables can grow very large; putting them in a separate file lets you move the main content quickly.

4. Import from the terminal with the mysql command

For very large databases, the command line is the most reliable route because browser and PHP limits no longer apply. Upload the file to your account via FTP or File Manager, then run the following in the terminal:

# Import (prompts for the password)
mysql -u firma_wpuser -p firma_wp < yedek.sql

# Import a compressed file without extracting it
gunzip < yedek.sql.gz | mysql -u firma_wpuser -p firma_wp

# Export
mysqldump -u firma_wpuser -p --single-transaction firma_wp | gzip > yedek.sql.gz

This method requires terminal or SSH access on your plan. Laravel hosting plans include Terminal/SSH access through cPanel, which makes them a practical choice for developers who regularly work with large databases.

Character set errors and utf8mb4

utf8mb4 is MySQL's full Unicode character set: it can store accented and non-Latin characters, emoji and every four-byte symbol. The older utf8 (actually utf8mb3) cannot store emoji, and latin1 garbles characters such as Turkish letters. For new projects, use utf8mb4 as the table and connection character set and utf8mb4_unicode_ci (or a newer utf8mb4 collation your server supports) as the collation.

If characters show up as "ü" or "ı"

This is called mojibake: UTF-8 data was read or written as latin1. The fix is to use the same character set (utf-8) for both export and import and to make sure the application opens its connection with utf8mb4. In WordPress, confirm that DB_CHARSET in wp-config.php is set to utf8mb4. Before re-importing broken data, open the file in a text editor and check that special characters display correctly; if they are already broken in the file, the problem is on the source server.

#1273 Unknown collation: utf8mb4_0900_ai_ci

This appears when you load a backup taken with MySQL 8 onto a server running MariaDB, because MariaDB does not have this collation. Replace it in the file with a compatible collation:

sed -i 's/utf8mb4_0900_ai_ci/utf8mb4_unicode_ci/g' yedek.sql

On Windows, you can make the same change with the Find and Replace feature of a text editor that can open large files.

Other common import errors

ErrorCauseFix
#1044 Access denied ... to databaseThe file contains a CREATE DATABASE line or a USE line with a different nameDelete those lines, select the target database and import again
#1227 ... SUPER privilege(s)Views, triggers or procedures contain a DEFINER= clauseRemove the DEFINER=`kullanici`@`host` parts from the file
#1050 Table already existsThe same table already exists on the targetCheck the DROP TABLE option when exporting or empty the target first
#1071 Specified key was too longThe utf8mb4 index length limit on an older serverMake sure the target server runs a current MySQL/MariaDB version
Blank page or timeoutThe file is too large and PHP ran out of timeCompress it, split it or import it from the terminal

Exporting a single table or query result

You do not always need the whole database. To send an order list to your accountant or review a member list in a spreadsheet, open the relevant table in phpMyAdmin and choose CSV or CSV for MS Excel as the format on the same Export tab. To export only certain rows, first run a query on the SQL tab, for example:

SELECT id, user_email, user_registered
FROM wp_users
WHERE user_registered >= '2025-01-01';

The Export link below the results table downloads only the result of that query. If special characters look garbled in Excel, do not open the file directly; use Excel's Data > From Text/CSV import tool and set the encoding to 65001: Unicode (UTF-8). Delete exports that contain personal data from your computer when you are done and do not share them with unauthorized people; this also matters under KVKK, Türkiye's personal data protection law.

Post-migration checklist

  • Compare the number of tables on the source and target using phpMyAdmin's Structure tab.
  • If you moved WordPress and the domain changed, check the siteurl and home values in the wp_options table. For a full site move, the guide to migrating a WordPress site to another host is more thorough.
  • Verify that the application's configuration file contains the new database name, username and password.
  • Do not leave the old backup file inside public_html; an SQL file in a public directory can leak all of your data.

Smooth migrations with the right hosting plan

The size and number of your databases directly affect the disk and database limits you need. Sunucu Atlas cPanel web hosting plans come with phpMyAdmin, NVMe storage and the LiteSpeed web server. If you run a single site, SA-CP-1 with 2 databases and 20 GB of NVMe storage may be enough; if you are moving several sites or a growing store database, the SA-CP-4 hosting plan with 20 databases and 80 GB of NVMe storage gives you more room. If you get stuck at any step of the migration, open a support ticket and our support team will help.

Frequently asked questions

What is the largest file I can upload in phpMyAdmin?

The limit is set by the server's upload_max_filesize and post_max_size PHP settings and is shown as the Max value on the Import page. Compressing the file with gzip usually brings it under that limit.

Special characters got garbled during import. What should I do?

Make sure the character set is utf-8 for both export and import, that the tables use utf8mb4, and that the application opens its connection with utf8mb4. If the characters are already broken in the file, export the backup again from the source server with the correct character set.

Why do I get the Unknown collation utf8mb4_0900_ai_ci error?

This collation is specific to MySQL 8 and does not exist in MariaDB. Replace utf8mb4_0900_ai_ci with utf8mb4_unicode_ci in the SQL file and import it again.

Can I import and export from the command line instead of phpMyAdmin?

If your plan includes terminal or SSH access, you can use the mysql and mysqldump commands without hitting browser or PHP limits. This is the most reliable method for large databases.

Should I check the CREATE DATABASE option when exporting?

Not on shared cPanel hosting. The database name on the target server will have a prefix, so this statement causes a permission error.

For this guide

Recommended plans

Sunucu Atlas web hosting plans come with phpMyAdmin, NVMe storage and database limits you can match to your needs, so you can import your backups without hassle and get your site live fast.

SA-CP-1

cPanel
Recommended

20 GB NVMe disk

$0.39/mo

+VAT

  • Memory1 GB
  • LocationIstanbul
  • 1 Hosted Domains
  • 50 GB Traffic
  • 5 Email Account Limit
  • 2 Databases

SA-CP-2

cPanel

40 GB NVMe disk

$0.69/mo

+VAT

  • Processor2 cores
  • Memory2 GB
  • LocationIstanbul
  • 1 Hosted Domains
  • 100 GB Traffic
  • 10 Email Account Limit
  • 5 Databases

SA-CP-3

cPanel

60 GB NVMe disk

$0.98/mo

+VAT

  • Processor3 cores
  • Memory3 GB
  • LocationIstanbul
  • 1 Hosted Domains
  • 200 GB Traffic
  • 25 Email Account Limit
  • 10 Databases

Web Hosting — all plans

Need help with setup?

Send questions about your service in a support ticket, and our technical team will walk you through it step by step.