Replication Compatibility Between MariaDB and MySQL

You are viewing an old version of this article. View the current version here.

This page describes replication compatibility between MariaDB and MySQL. For replication compatibility details between different MariaDB versions, see Cross-Version Replication Compatibility.

Replication Compatibility

Replication compatibility depends on:

  • The MariaDB version
  • The MySQL version
  • The role of each server

Replicating from MySQL to MariaDB

MySQL 5.7 to MariaDB

MariaDB 10.2 and later can replicate from a MySQL 5.7 primary server.

MariaDB does not support the MySQL implementation of Global Transaction IDs (GTIDs), so the MariaDB replica server must use the binary log file and position for replication. If GTID mode is enabled on the MySQL primary server, the MariaDB replica server will remove the MySQL GTID events and replace them with MariaDB GTID events.

Although MariaDB and MySQL 5.7 are compatible at the replication level, they may have some incompatibilities at the SQL level. Those differences can cause replication failures in some cases. To decrease the risk of compatibility issues, it is recommended to set binlog_format to ROW. When you want to replicate from MySQL 5.7 to MariaDB, it is recommended to test your application, so that any compatibility issues can be found and fixed. See Incompatibilities and Feature Differences between the specific versions.

MySQL 8.0 to MariaDB

Prior to MariaDB 10.6.21, MariaDB 10.11.11, MariaDB 11.4.5 and MariaDB 11.7.2, MariaDB Server could not replicate from a MySQL 8.0 primary server, because MySQL 8.0 has a binary log format that is incompatible.

MariaDB 10.6.21, MariaDB 10.11.11, MariaDB 11.4.5, MariaDB 11.7.2 and newer can replicate from a MySQL 8.0 server with the following conditions:

  • MariaDB does not support the MySQL default authentication caching_sha2_password, so one has to add another replication user using the mysql_native_password protocol.
  • Columns of type JSON are not supported. One should change these to TEXT.
  • binlog-row-value-options should be set to "" should be set. This disables the incompatible PARTIAL_UPDATE_ROWS_EVENT event.
  • binlog_transaction_compression should be set to 0. This disables binlog compression and the incompatible TRANSACTION_PAYLOAD_EVENT event.
  • MySQL 8.0 utf8mb4_ja_0900_ collations are not used when replicating to MariaDB 10.6 - MariaDB 11.4.4. MariaDB 11.4.5 and above will support most of the MySQL 8.0 utf8mb4_ja_0900_... collations.
  • For differences at the SQL level that may cause replication failures, see Incompatibilities and Feature Differences between the specific versions.

Replicating from MariaDB to MySQL

Here are some issues to be aware of when replicating from MariaDB to MySQL.

On the MySQL side, one should:

On the MariaDB side, one should:

For differences at the SQL level that may cause replication failures, see Incompatibilities and Feature Differences between the specific versions.

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.