Tutorial··5 min read

Importing a MySQL Dump Into MariaDB (and Vice Versa)

MySQL and MariaDB look interchangeable until you import across them. The exact incompatibilities and how to clear each one.

MariaDB started as a MySQL fork, so most dumps move across without a hitch. The friction is almost entirely about version-specific features that crept in after the fork — here's the short list that actually causes import failures.

MySQL 8 → MariaDB: the usual blockers

The collation issue is by far the most common. One sed pass usually clears the import:

sed -i 's/utf8mb4_0900_ai_ci/utf8mb4_unicode_ci/g' dump.sql
mysql -u user -p target_db < dump.sql

MariaDB → MySQL: watch these

  • MariaDB-specific engines (Aria, ColumnStore) — MySQL will reject the ENGINE clause; convert to InnoDB
  • PAGE_CHECKSUM / TRANSACTIONAL table options — strip them
  • JSON stored as LONGTEXT in older MariaDB — usually imports fine, but indexes may differ
  • Sequences (MariaDB 10.3+) — MySQL has no equivalent; convert to AUTO_INCREMENT
# Force everything to InnoDB on the way in
sed -i 's/ENGINE=Aria/ENGINE=InnoDB/g' dump.sql

The clean approach: export for the target

If you still have the source server, exporting with the destination in mind saves all the post-processing. Keep the dump portable:

mysqldump --no-tablespaces --skip-add-locks \
  --default-character-set=utf8mb4 \
  database_name > dump.sql
User accounts, privileges, and auth plugins differ between the two. Migrate schema + data only, then recreate users on the target with CREATE USER / GRANT.

Cross-engine migration of a big database?

Split the dump so you can apply find-and-replace fixes per chunk and re-run only the parts that fail.

Open SQLSplit

Frequently Asked Questions

Can I import a MySQL dump directly into MariaDB?

Usually yes. The main exception is MySQL 8 dumps, which often use the utf8mb4_0900_ai_ci collation and other MySQL-8-only features MariaDB doesn't recognise. Replace the collation and strip VISIBLE/INVISIBLE index keywords first.

What breaks when importing MariaDB into MySQL?

MariaDB-specific storage engines (Aria, ColumnStore), table options like PAGE_CHECKSUM, and sequences. Convert engines to InnoDB and remove unsupported options before importing into MySQL.

Should I dump user accounts when migrating between MySQL and MariaDB?

No. Authentication plugins and the mysql system tables differ between them. Migrate only your application schema and data, then recreate users with CREATE USER and GRANT on the target.

Related articles

View all

Advertisement