Moving binary logs in MySQL to another hard drive

This question is about MySQL binary logs.

We need to move the binary log to another hard drive.

What configuration change is required in MySQL?

Currently, binary logs are in the same folder as ibdata, and a replication slave is running that needs binary logs.

+7
mysql
source share
2 answers

Change the log file. BUT you need to first copy the log file files to a new location and change the index file. If you do not, you will break your remote slave with an error:

Fatal error 1236 was received from the master while reading data from a binary log: "Could not find the first log file name in the binary log index file"

More details here: http://freebsd.down-to-details.com/sys-admin/relocating-moving-mysql-binlogs/

+7
source share

From the moment I read the document , you can specify the path to the log configuration.

To enable binary logging, start the server with the -log-bin [= base_name] option. If base_name is not specified, the default is the pid parameter of the file (which default is the host name) and then -bin. If the base name, this server writes the file to the data directory , if the base name is given with a leading absolute path name to indicate another directory . It is recommended to specify a base name; see section C.5.8, β€œKnown Issues in MySQL”, for this reason.

+2
source share

All Articles