Full-service Internet Marketing & Web Development
Recent Posts

Sponsors
![]() |
How to manually process MySQL replication log filesMike Peters, 07-15-2009 |
MySQL replication log files are simple text files, with a dump of all queries issued on the designated server.
At certain times, when MySQL slave servers fall behind, it may be useful to copy the log files over from the master to the slave machines and then manually process them.
To process a MySQL replication log file, copy the file from the master to the slave machine, then issue this command:
Replace 1234 with the last position the slave was able to read
Replace mysql-bin.000001 with the master file name
And replace USERNAME/PASSWORD with the slave database credentials
At certain times, when MySQL slave servers fall behind, it may be useful to copy the log files over from the master to the slave machines and then manually process them.
To process a MySQL replication log file, copy the file from the master to the slave machine, then issue this command:
mysqlbinlog /usr/tmp/mysql-bin.000001 --start-position=1234 | sed -e 's/SET \/\*\!\*\//SET AUTOCOMMIT=0/g' | mysql -uUSERNAME -pPASSWORD
Replace 1234 with the last position the slave was able to read
Replace mysql-bin.000001 with the master file name
And replace USERNAME/PASSWORD with the slave database credentials
|
|
Subscribe Now to receive new posts via Email as soon as they come out.
Comments
Post your comments

