I'm using MySQL replication, and I'd like a status script running on the slave to report the last statement that was replicated over to the slave.
I can use "SHOW SLAVE STATUS" to get the current read and execute positions. But how do I use that information with mysqlbinlog to read the last entry? Assuming the slave is caught up with the master, the following statement returns nothing useful:
mysqlbinlog.exe -R --start-position=<READ_MASTER_LOG_POS> <MASTER_LOG_FILE> -h <MASTER_HOST>
I can't seem to minus one from the log position to get the previous statement, and I don't see any way to give a negative offset meaning to read from the end in reverse order. Is there any way to do this?
Thanks!