binlog的sql命令:mysql
SHOW VARIABLES LIKE 'log_%'; 查询各类log是否开启sql
SHOW MASTER STATUS; 查询当前binlog文件position状态日志
SHOW BINLOG EVENTS; 查看binlog日志记录状况,每组position位置作了哪些操做,也须要开启binlog-format=Row配置参数来支持orm
binlog客户端命令:it
mysqlbinlog mysql-bin.000001 --start-position 120 --stop-position 578|mysql -uroot -p 用于依据binlog文件,进行数据恢复io
从库中使用命令指向主库:ast
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=0form