0

I am using the following command to start reading mysqlbinlog.

mysqlbinlog -t -v -v --base64-output=DECODE-ROWS -h my_host -ppasswd -R mysql-bin.000960 -j 1052323996

I would expect the output to continue to the next log file, since I am using -t, but mysqlbinlog just exits.

How can I make this command continue to output log entries, like a tail -f would?

Thank you

simao
  • 151
  • 5

1 Answers1

0

mysqlbinlog command's -t option does not work like tail command's -f option. With -t option, it will keep processing all the binary log files which currently exist. Once it reaches the end of the last binary log it will end, unless new data was written, before mysqlbinlog reached the end.

One such tool that will "follow" the binary log is mysql_binlog_dump. (I have not tried the tool myself.)

Looking at mysqlbinlog --help for MySQL 5.5, it says:

  -t, --to-last-log   Requires -R. Will not stop at the end of the requested
                      binlog but rather continue printing until the end of the
                      last binlog of the MySQL server. If you send the output
                      to the same MySQL server, that may lead to an endless
                      loop.
dabest1
  • 252
  • 1
  • 2
  • 9