Announcement Module
No announcement yet.

Mysql binary log query

Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mysql binary log query

    I am reading MySQL binary log, my mysql-bin.index contains :


    Before few days the file had names with index starting from mysql-bin.000163, I was not abel to find any information online when does MySQL rotates binary log files, I want to get first data modification query on the database.

    Is there a way to do that using binary logs ?

  • #2

    You should check the size of max_binlog_size, default value is 1GB. So whenever your current binlog file's size reaches to max_binlog_size, it will automatically rotate to new binlog file. Check more details here,

    You should check at the location of binlog file if its exist or not. In your case, it is /var/log/mysql/
    If it exist then only you can check the content of that file by using mysqlbinlog. i.e

    shell> mysqlbinlog /var/log/mysql/mysql-bin.000163

    You can also check the value of expire_logs_days, if you crosses that value then your binlog will be automatically purged.