Migrating from MariaDB 10.3 to MySQL 5.7.25: Common Issues and Solutions
This article details the practical challenges encountered when migrating a MariaDB 10.3 database to MySQL 5.7.25, explains why certain defaults and engine-specific options cause import errors, and provides step‑by‑step fixes such as adjusting default expressions, removing Aria‑specific parameters, and configuring sql_mode.
Background
MariaDB was created by the MySQL founder after MySQL was sold to Sun and later acquired by Oracle; it is fully compatible with MySQL and often used as a drop‑in replacement, for example in CentOS 7. The article discusses a real‑world migration from MariaDB 10.3 to MySQL 5.7.25 and the problems encountered.
Brief Operation Process
Because MariaDB switched to a versioning scheme starting at 10.0 after 5.5, MariaDB 10.3 is theoretically compatible with MySQL 5.7. The migration steps were: remove MySQL‑incompatible parameters from my.cnf , install MySQL, dump the MariaDB databases with mysqldump , and import the dump into MySQL.
Data Import Errors
1. md5(uuid())
The import failed because MySQL does not allow function calls such as md5(uuid()) in a column's DEFAULT clause, whereas MariaDB (since 10.2.1) permits expressions in defaults. This mismatch caused a syntax error.
2. PAGE_CHECKSUM
The PAGE_CHECKSUM=1 option appears in the table definition of an Aria engine table. Aria is exclusive to MariaDB; MySQL lacks this engine and the associated option, leading to another import error.
Application Test Errors
During runtime, a query failed because MySQL 5.7 enables the ONLY_FULL_GROUP_BY mode by default, while the original MariaDB environment did not. The missing column in the GROUP BY clause triggered the error. Adjusting sql_mode to remove ONLY_FULL_GROUP_BY resolved the issue.
Conclusion
Database migration requires more than checking high‑level compatibility; detailed testing and careful review of engine‑specific features, default expressions, and SQL modes are essential to ensure data integrity and application stability.
Aikesheng Open Source Community
The Aikesheng Open Source Community provides stable, enterprise‑grade MySQL open‑source tools and services, releases a premium open‑source component each year (1024), and continuously operates and maintains them.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.