Skip to Content
MySQL 8 Cookbook
book

MySQL 8 Cookbook

by Karthik Appigatla
January 2018
Intermediate to advanced
446 pages
12h 57m
English
Packt Publishing
Content preview from MySQL 8 Cookbook

Getting ready

Execute a few statements using various binary formats. When you set the binlog_format at GLOBAL level, you have to disconnect and reconnect to get the changes. If you want to be connected, set at SESSION level.

Change to statement-based replication (SBR):

mysql> SET @@GLOBAL.BINLOG_FORMAT='STATEMENT';Query OK, 0 rows affected (0.00 sec)

Update a few rows:

mysql> BEGIN;Query OK, 0 rows affected (0.00 sec)mysql> UPDATE salaries SET salary=salary*2 WHERE emp_no<10002;Query OK, 18 rows affected (0.00 sec)Rows matched: 18  Changed: 18  Warnings: 0mysql> COMMIT;Query OK, 0 rows affected (0.00 sec)

Change to row-based replication (RBR):

mysql> SET @@GLOBAL.BINLOG_FORMAT='ROW';Query OK, 0 rows affected (0.00 sec)

Update a few rows:

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

MySQL Cookbook

MySQL Cookbook

Paul DuBois
Advanced MySQL 8

Advanced MySQL 8

Eric Vanier, Birju Shah, Tejaswi Malepati

Publisher Resources

ISBN: 9781788395809Other