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