How to do it...

MySQL Utilities should be installed for using the mysqlbinlogmove script. Refer to Chapter 1, MySQL 8.0 – Installing and Upgrading,  for installation steps.

  1. Stop the MySQL server:
shell> sudo systemctl stop mysql
  1. Start the mysqlbinlogmove utility. If you want to change the binary logs from /data/mysql/binlogs to /binlogs, the following command should be used. If your base name is not default, you have to mention your base name through the --bin-log-base name option:
shell> sudo mysqlbinlogmove --bin-log-base name=server1  --binlog-dir=/data/mysql/binlogs /binlogs## Moving bin-log files...# - server1.000001# - server1.000002# - server1.000003# - server1.000004# - server1.000005##...done.#
  1. Edit the my.cnf file and update ...

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.