标签:新建 ted 打开 from format cee primary highlight default
log-bin=E:/soft/mysql-5.7.23-winx64/log/masami-bin binlog-format=MIXED
#停止命令 net stop mysql #启动命令 net start mysql #登陆到mysql操作 mysql -u root -p #查看mysql版本 status;
show variables like "%log_bin%";
show variables like "%binlog_format%";
首先确保日志是空的,我们先清理一下日志 reset master;
mysql> create database binlog; Query OK, 1 row affected (0.00 sec) mysql> use binlog; Database changed mysql> create table test( id int auto_increment not null primary key, val int, data varchar(20) ); Query OK, 0 rows affected (0.01 sec) mysql> insert into test(val, data) values (10, ‘wu‘); Query OK, 1 row affected (0.02 sec) mysql> insert into test(val, data) values (20, ‘yang‘); Query OK, 1 row affected (0.01 sec) mysql> insert into test(val, data) values (20, ‘ping‘); Query OK, 1 row affected (0.01 sec) mysql> delete from test where id = 3; Query OK, 2 rows affected (0.01 sec) mysql> insert into test(val, data) values (40, ‘ping123‘); Query OK, 1 row affected (0.01 sec) mysql> insert into test(val, data) values (50, ‘ping163‘); Query OK, 1 row affected (0.01 sec) mysql> drop table test; Query OK, 0 rows affected (0.01 sec) mysql> drop database binlog; Query OK, 0 rows affected (0.00 sec)
mysqlbinlog masami-bin.000001 > 1.txt
mysqlbinlog 一些参数如下 这里我使用 --start-position 和 stop-position来做操作 --database ##与"-d"作用相同,用于指定数据 -d ##与“database”作用相同,用于指定数据库 --start-datetime ##起始时间点 --stop-datetime ##结束时间点 --start-position ##起始位置 --stop-position ##结束位置 注意: 如果只是指定了--start-position 那他会从start-position到这个文件结束 如果只是指定了--stop-position 那他会从问价开始到stop-position
mysqlbinlog masami-bin.000001 --stop-position=1305 | mysql -uroot -proot
mysqlbinlog masami-bin.000001 --start-position=1579 --stop-position=2257| mysql -uroot -proot
标签:新建 ted 打开 from format cee primary highlight default
原文地址:https://www.cnblogs.com/dabenxiang/p/11387216.html