Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

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.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.