PHP/MariaDB/MySQL

What is the proper MariaDB - MySQL import and export format?

Updated November 2026 11,723 views 3 min read
PHP/MySQL | Updated November 2026

When importing or exporting MariaDB/MySQL databases, the format matters. An incorrect format can cause import failures, data corruption, or encoding issues. Here are the correct formats and settings for database operations on your hosting account.

01. Exporting (Backing Up)

In phpMyAdmin (cPanel > Databases > phpMyAdmin):

  1. Select your database from the left sidebar
  2. Click "Export"
  3. Choose "Custom" for full control over settings
  4. Format: SQL
  5. Check "Add DROP TABLE" under "Object creation options" - This makes the export self-contained for clean restores
  6. Compression: gzip for large databases (keeps the file size down)
  7. Click "Go"

The resulting .sql (or .sql.gz) file is your backup. Store it somewhere safe.

For alternative backup methods including SSH and automated backups, see How to Backup a MySQL Database.

02. Importing (Restoring)

In phpMyAdmin:

  1. Select the target database (it should already exist in cPanel > MySQL Databases)
  2. Click "Import"
  3. Click "Choose File" and select your .sql or .sql.gz file
  4. Character set: utf-8
  5. Format: SQL
  6. Click "Go"

For full import instructions and troubleshooting, see How to Import Into MySQL.

File Size Limits

phpMyAdmin has an upload limit (typically 128MB on our servers). If your database dump is larger than this, use SSH instead: mysql -u dbuser -p dbname < backup.sql. Or split the file into smaller chunks using a tool like BigDump.

03. CSV Format

CSV (Comma-Separated Values) is useful for importing data from spreadsheets into a database table, but it is not a good format for full database backups because it does not include table structure, indexes, or relationships.

To import CSV data into a specific table in phpMyAdmin: select the table, click "Import," choose CSV format, and map the columns. This appends data to the existing table.

04. Character Encoding

Encoding mismatches are one of the most common causes of garbled text after an import. Tips:

  • WordPress uses utf8mb4 - Make sure both export and import use utf8mb4, not just utf8. utf8mb4 supports emoji and 4-byte characters.
  • Match the source encoding - If the original database was created with latin1, export it as latin1 and convert during import, or use a tool that handles the conversion.
  • Check after import - If you see characters like é instead of é, there is an encoding mismatch. Re-import with the correct character set.

Import/Export Trouble?

If your import is failing or you see corrupted characters after a restore, open a ticket with the error message and we will help.

Open a Support Ticket

Frequently Asked Questions

What format should I use to export a MySQL database?

Export as a .sql dump, which is the standard and most reliable format for backups and migrations. In phpMyAdmin choose the SQL export; it includes the table structure and data so the database can be recreated exactly on import.

Why does my database import fail with a format or encoding error?

Usually the file is not a clean .sql dump, or the character set does not match. Export and import as UTF-8 (utf8mb4) to avoid garbled characters, and make sure the dump is plain SQL rather than a compressed or proprietary format phpMyAdmin cannot read.

Can I import a CSV into my database?

Yes, phpMyAdmin can import CSV into an existing table, but you must map the columns correctly and the table must already exist with a matching structure. For full database backups and restores, a .sql dump is the right format, not CSV.

What character encoding should I use?

Use UTF-8, specifically utf8mb4, for both export and import so accented characters, emoji, and non-Latin text survive intact. A mismatch between the dump's encoding and the database's is the usual cause of question marks or garbled text after an import.

Quick Recap

  1. Use SQL format for database exports - not CSV for full backups
  2. Include DROP TABLE statements for clean restores
  3. Use utf8mb4 encoding (especially for WordPress)
  4. Compress large exports with gzip to keep file sizes manageable
  5. Use SSH for files over 128MB that exceed phpMyAdmin's upload limit

Database management best practices · Last updated November 2026 · Browse all PHP/MySQL articles

Share: X in Reddit f Email
  • 655 Users Found This Useful

Was this answer helpful?

Related Articles

What Port is MariaDB/MySQL On?

PHP/MariaDB/MySQL | Updated September 2026 MariaDB/MySQL runs on port 3306 by default on...

Cannot Connect to MariaDB MySQL Database

PHP/MariaDB/MySQL | Updated November 2026 The "Could not connect to the database" error means...

How to Add a User to a MariaDB/MySQL Database

PHP/MariaDB/MySQL | Updated November 2026 Every application that uses a database (WordPress,...

PHP system exec Functions Disabled on Shared Hosting

PHP/MariaDB/MySQL | Updated November 2026 The error "Warning: system() has been disabled for...

Disable MySQL strict mode on cPanel server

Databases | Updated January 2026 MySQL/MariaDB strict mode enforces stricter data validation...



Save 30% on web hosting - Use coupon code Hosting30