Error: Bogus Data in Log Event
Issue
Syncs fail. The following error appears:
Bogus data in log event
Environment
Connector: MySQL
Resolution
To resolve this issue, do the following:
In your database, ensure automatic binary log file removal is disabled or the retention period is set to at least seven days. Check the current setting. The query depends on your MySQL version:
In MySQL versions 5.5 to 8.0.0, the parameter to control binary log expiration (in days) is
expire_logs_days
. Starting with 8.0.1, a new parameterbinlog_expire_logs_seconds
lets you set expiration in seconds. From 8.0.3 onward, theexpire_logs_days
parameter is deprecated, so you must use thebinlog_expire_logs_seconds
parameter instead. In versions that support both parameters, set only one of them to avoid unintended retention periods.MySQL 5.5–8.0.2
SHOW VARIABLES LIKE 'expire_logs_days';
- If the returned value is
0
, automatic binary log file removal is disabled and you don't need to take any action. - If the value is greater than
0
, but less than7
, update it:SET GLOBAL expire_logs_days = 7;
- If the returned value is
MySQL 8.0.1 and later
SHOW VARIABLES LIKE 'binlog_expire_logs_seconds';
- If the returned value is
0
, automatic binary log file removal is disabled and you don't need to take any action. - If the value is greater than
0
, but less than604800
(7 days), update it:SET GLOBAL binlog_expire_logs_seconds = 604800;
- If the returned value is
In Fivetran, go to your MySQL connector page.
Select the Setup tab.
Click Resync all historical data.
In the confirmation pop-up window, click Re-sync Connector.
Cause
This issue occurs when a binary log file becomes corrupted. This may happen due to any of the following reasons:
- You have enabled automatic binary log file removal in your database, and the retention period is set to less than the recommended seven days.
- You have run commands that may have intentionally deleted binary log files, such as
PURGE BINARY LOGS
orRESET MASTER
. - Recent significant database changes or server crashes have impacted the binary log file or its position.