I have an application that listens to the MySQL 5.6/5.7 binary log. It requires binlog_format to be set to ROW. This is working perfectly on RDS but I can't get the setting to work in a docker container for testing.

My docker config puts these settings in a file in /etc/mysql/conf.d/:

[mysqld]
server-id=1
log_bin=binlog
binlog_format=ROW
innodb_flush_log_at_trx_commit=1

Logging into the container I can see it's set correctly, both globally and in the session:

mysql> show global variables where variable_name = 'binlog_format';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| binlog_format | ROW   |
+---------------+-------+
mysql> show variables where variable_name = 'binlog_format';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| binlog_format | ROW   |
+---------------+-------+

When I run my application I only see event types QUERY_EVENT and XID_EVENT when updating rows. I'm missing WRITE_ROWS_EVENT, UPDATE_ROWS_EVENT, and DELETE_ROWS_EVENT. The mysqlbinlog command confirms row-basd replication is working. From the application acting as a slave it appears statement-based logging is running while the server confirms it's row-based. Rotating logs, restarting, etc. have no affect. How's this possible and what's the fix?

  • How is your application consuming events? Does mysqlbinlog on the binlog file show row events? – danblack Oct 18 at 21:35
  • I'm using the python-mysql-replication library. The mysqlbinlog command confirms binary logging is enabled. I don't see the same events from my application "slave". Although the update statements I'm running do appear (as query events in the app and row events in the server logs). – Matt S Oct 18 at 22:13

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.