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

Enabling binary logs

  1. Enable binary logging and set the server_id. Open the MySQL config file in your favorite editor and append the following lines. Choose server_id such that it will be unique to each MySQL server in your infrastructure. You can also simply put the log_bin variable in my.cnf without any value. In that case, the binary log is created in the data directory directory and uses hostname as its name.
shell> sudo vi /etc/my.cnf[mysqld]log_bin = /data/mysql/binlogs/server1server_id = 100
  1. Restart the MySQL server:
shell> sudo systemctl restart mysql
  1. Verify that binary logs are created:
mysql> SHOW VARIABLES LIKE 'log_bin%';+---------------------------------+-----------------------------------+| Variable_name                   | Value                             |+---------------------------------+-----------------------------------+ ...
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