This question is about MySQL binary logs.
We need to move a binary log to a different hard disk.
What is the configuration change required in MySQL?
Currently binary logs go into the same folder as the ibdata and there is a replication slave running which needs the binary logs.
The MySQL binary logs and index files are saved in the C:\ProgramData\MySQL\MySQL Server 8.0 directory. We can change the default location of the binary logs.
To safely purge binary log files, follow this procedure: On each replica, use SHOW REPLICA STATUS to check which log file it is reading. Obtain a listing of the binary log files on the source with SHOW BINARY LOGS . Determine the earliest log file among all the replicas.
The binary log is a set of log files that contain information about data modifications made to an MySQL server instance. The binary log contains information such as the following: Events that describe database changes such as table creation or row modifications.
The MySQL BinLogs serve two important purposes: Replication: When working on a master server, the binary logs contain a record of the changes that have occurred. These records are sent to the slave servers to help them execute those events & make the same data changes that were made on the master server.
Changing the log-bin works. BUT you need to copy the log-bin files first to the new location and modify the index file. If you dont'do this you will break your remote slave with the error:
Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'
More info here: http://freebsd.down-to-details.com/sys-admin/relocating-moving-mysql-binlogs/
From the way I read the doc, you can specify a path on the log-bin config.
To enable the binary log, start the server with the --log-bin[=base_name] option. If no base_name value is given, the default name is the value of the pid-file option (which by default is the name of host machine) followed by -bin. If the basename is given, the server writes the file in the data directory unless the basename is given with a leading absolute path name to specify a different directory. It is recommended that you specify a basename; see Section C.5.8, “Known Issues in MySQL”, for the reason.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With