How to do it...

You can set the format using the dynamic variable, binlog_format, which has both global and session scope. Setting it at global level makes all clients use the specified format: 

mysql> SET GLOBAL binlog_format = 'STATEMENT';

Or:

mysql> SET GLOBAL binlog_format = 'ROW'; 

Refer to https://dev.mysql.com/doc/refman/8.0/en/replication-sbr-rbr.html to learn about the advantages and disadvantages of various formats.

  1. MySQL 8.0 uses version 2 binary log row events, which cannot be read by MySQL Server releases prior to MySQL 5.6.6. Set log-bin-use-v1-row-events to 1 to use version 1 so that it can be read by versions prior to MySQL 5.6.6. The default is 0.
mysql> SET @@GLOBAL.log_bin_use_v1_row_events=0;
  1. When you create a stored ...

Get MySQL 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.