Skip to main content
4 of 4
replaced http://dba.stackexchange.com/ with https://dba.stackexchange.com/

You cannot convert a binlog to another version, but you import its SQL as long as have mysqlbinlog for version 4.1.

Simply do the following:

  • Run MySQL 4.1 version of mysqlbinlog against the MySQL 4.1 binlog, saving output to stmts.sql
  • Install MySQL 5.x with these in my.cnf
  • log-bin=mysql-bin
  • binlog-format=ROW
  • Login to MySQL 5.1 and run source stmts.sql
  • Run SHOW BINARY LOGS;

When done, the binlogs you see should be row-based.

Give it a Try !!!

Why can't you just convert ? The BINLOG Magic Number gets displaced with later versions.

I wrote about before

Every time you restart mysql, the next empty binlog is created. Each version of MySQL has a different size:

  • MySQL 5.6 : 120
  • MySQL 5.5 : 107
  • MySQL 5.1 : 106
  • MySQL 5.0 : 98

In light of this, generating binlogs from scratch is the best way to go.

UPDATE : Thanks to Michael's Comment, you have to preload the data the binlog came from into the MySQL 5.1 Instance.

RolandoMySQLDBA
  • 184.3k
  • 33
  • 323
  • 531