Formatting code for MysqlBinlog


show source only

{{parent page="MySQL"}}

===Messing with binlogs===

==Show binlog positions in a log file==
%%
mysqlbinlog <log file> | grep log_pos
%%

==See if a log file is corrupted==
%%
mysqlbinlog <log file> > /dev/null
%%

==Create dump file from binlog==
%%
mysqlbinlog --start-date="2009-02-20 8:00:00" --stop-date="2009-02-21 8:00:00" \
/var/log/mysql/bin.000001 > /tmp/mysql_restore.sql

mysqlbinlog --stop-position="12345" /var/log/mysql/bin.000001 > /tmp/restore.sql
mysqlbinlog --start-position="12345" /var/log/mysql/bin.000001 > /tmp/restore.sql
%%
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki