Comments - Replication slave loses connection and does not recover

5 years, 7 months ago Ian Light
This comment has the status of 'removed' and can only be seen by you.

Symptom: Starting the Slave manually causes replication to initially succeed (for a minute or two), but the Slave subsequently stops after reporting a failure to connect to the Master, similar to the error below: 2018-09-17 16:03:12 13 [Warning] Slave I/O: Notifying master by SET @master_binlog_checksum= @@global.binlog_checksum failed with error: Unknown system variable 'binlog_checksum', Internal MariaDB error code: 1193 2018-09-17 16:04:12 13 [ERROR] Error reading packet from server: Lost connection to MySQL server during query (server_errno=2013)

Remediation: Make sure that both Master and Slave are using the same character sets.

Cure: If you are replicating between a much older version of MySql (lets say 5.1) and a current MariaDB 10.3.X instance... the older version of MySql may not be aware of the utf8mb4 issue (versus utf8). utf8mb4 is probably the default in newer MySql and MariaDB instances. So, in your my.ini (or equivalent), make sure that you comment out the utf8mb4, and explicitly set the utf8 options in the newer slave server.

i.e.

  1. character-set-server=utf8mb4
  2. collation-server=utf8mb4_general_ci character-set-server=utf8 collation-server=utf8_general_ci

If replicating between newer servers, please also confirm that the character sets in use are the same on Master and Slave (in this instance, it's preferable for both servers to use utf8mb4, but the key is to make sure that they both use the same setting).

 
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.