mysqlbinlog二三事儿

binlog的sql命令:

SHOW VARIABLES LIKE 'log_%';  查询各种log是否开启

SHOW MASTER STATUS; 查询当前binlog文件position状态

SHOW BINLOG EVENTS; 查看binlog日志记录情况,每组position位置做了哪些操作,也需要开启binlog-format=Row配置参数来支持

 

binlog客户端命令:

mysqlbinlog mysql-bin.000001 --start-position 120 --stop-position 578|mysql -uroot -p   用于依据binlog文件,进行数据恢复

从库中使用命令指向主库:

change master to master_host='127.0.0.1',master_port=3308,master_user='root',master_password='123456',master_log_file='mysql-bin.000001',master_log_pos=0

 

posted @ 2019-09-20 13:37  soft.push("zzq")  Views(136)  Comments(0Edit  收藏  举报