Find us on Google+ Google+

November 9, 2018

MySQL mysqlbinlog utility

mysql binlog utility

mysqlbinlog --> binary log processing utility in MySQL


mysqlbinlog log_file

mysqlbinlog -v log_file
mysqlbinlog -vv log_file

mysqlbinlog logfile_1 logfile_2 ... logfile_n > out.sql
mysqlbinlog logfile_1 logfile_2 ... logfile_n | mysql

mysqlbinlog mysql-binlog.003510 | more

/usr/local/mysql/bin/mysqlbinlog --stop-datetime="2018-11-10 05:00:00" /home/mysql/binlog/mysql-bin.000033

/usr/local/mysql/bin/mysqlbinlog --start-datetime="2018-09-21 16:30:00" /home/mysql/binlog/mysql-bin.000006 /home/mysql/binlog/mysql-bin.000008 /home/mysql/binlog/mysql-bin.000009 | /usr/local/mysql/bin/mysql -u mysqldba -p test

mysqlbinlog -v --base64-output=decode-rows mysql-bin-log.00052

mysqlbinlog --base64-output=decode-rows --verbose /logs/mysql-bin-log.00052 > 52.log

mysqlbinlog --no-defaults --base64-output=decode-rows --verbose --verbose /logs/dba-mysql-bin.0000395 > 395.log

sudo mysqlbinlog --start-position=3214331 /mysql/mysql_logs/mysql-bin.00920 | more

mysqlbinlog /mysql/binlog/mysql-bin-log.000999 | grep -i -e "^update" -e "^insert" -e "^delete" -e "^replace" -e "^alter" | cut -c1-100 | tr '[A-Z]' '[a-z]' | sed -e "s/\t/ /g;s/\`//g;s/(.*$//;s/ set .*$//;s/ as .*$//" | sed -e "s/ where .*$//" | sort | uniq -c | sort -nr

mysqlbinlog --read-from-remote-server --host=host_name --raw mysql-binlog.000130 mysql-binlog.000131 mysql-binlog.000132

mysqlbinlog --read-from-remote-server --host=host_name --raw --stop-never 
mysql-binlog.000190

mysqlbinlog --start-position=12330 mysql-binlog.001002 mysql-binlog.001003 mysql-binlog.001004 | mysql --host=host_name -u root -p


Related Articles:  
mysqlimport commands      mysql_config_editor commands

No comments:

Post a Comment