jsp mysql 备份与恢复 博客园_Mysql备份与还原实例

mysql> show binarylogs;+------------------+-----------+

| Log_name | File_size |

+------------------+-----------+

| mysql-bin.000001 | 593 |

+------------------+-----------+

1 row in set (0.00sec)

mysql>flush logs;

Query OK,0 rows affected (0.01sec)

mysql>show binlog events;+------------------+-----+-------------+-----------+-------------+---------------------------------------------------------+

| Log_name | Pos | Event_type | Server_id | End_log_pos | Info |

+------------------+-----+-------------+-----------+-------------+---------------------------------------------------------+

| mysql-bin.000001 | 4 | Format_desc | 1 | 107 | Server ver: 5.5.22-log, Binlog ver: 4 |

| mysql-bin.000001 | 107 | Query | 1 | 175 | BEGIN |

| mysql-bin.000001 | 175 | Query | 1 | 270 | use `jack`; insert into echo values(4,'ccc') |

| mysql-bin.000001 | 270 | Xid | 1 | 297 | COMMIT /*xid=176*/ |

| mysql-bin.000001 | 297 | Query | 1 | 365 | BEGIN |

| mysql-bin.000001 | 365 | Query | 1 | 460 | use `jack`; insert into echo values(5,'ddd') |

| mysql-bin.000001 | 460 | Xid | 1 | 487 | COMMIT /*xid=177*/ |

| mysql-bin.000001 | 487 | Query | 1 | 593 | use `jack`; DROP TABLE `echo` /*generated by server*/ |

| mysql-bin.000001 | 593 | Rotate | 1 | 636 | mysql-bin.000002;pos=4 |

+------------------+-----+-------------+-----------+-------------+---------------------------------------------------------+

9 rows in set (0.00sec)----从上面可以看出drop table 是在487----

mysql> show binarylogs;+------------------+-----------+

| Log_name | File_size |

+------------------+-----------+

| mysql-bin.000001 | 636 |

| mysql-bin.000002 | 107 |

+------------------+-----------+

2 rows in set (0.00sec)

mysql> show binlog events in 'mysql-bin.000001'\G;*************************** 1. row ***************************Log_name: mysql-bin.000001Pos:4Event_type: Format_desc

Server_id:1End_log_pos:107Info: Server ver:5.5.22-log, Binlog ver: 4

*************************** 2. row ***************************Log_name: mysql-bin.000001Pos:107Event_type: Query

Server_id:1End_log_pos:175Info:BEGIN

*************************** 3. row ***************************Log_name: mysql-bin.000001Pos:175Event_type: Query

Server_id:1End_log_pos:270Info:use `jack`; insert into echo values(4,'ccc')*************************** 4. row ***************************Log_name: mysql-bin.000001Pos:270Event_type: Xid

Server_id:1End_log_pos:297Info:COMMIT /*xid=176*/

*************************** 5. row ***************************Log_name: mysql-bin.000001Pos:297Event_type: Query

Server_id:1End_log_pos:365Info:BEGIN

*************************** 6. row ***************************Log_name: mysql-bin.000001Pos:365Event_type: Query

Server_id:1End_log_pos:460Info:use `jack`; insert into echo values(5,'ddd')*************************** 7. row ***************************Log_name: mysql-bin.000001Pos:460Event_type: Xid

Server_id:1End_log_pos:487Info:COMMIT /*xid=177*/

*************************** 8. row ***************************Log_name: mysql-bin.000001Pos:487Event_type: Query

Server_id:1End_log_pos:593Info:use `jack`; DROP TABLE `echo` /*generated by server*/

*************************** 9. row ***************************Log_name: mysql-bin.000001Pos:593Event_type: Rotate

Server_id:1End_log_pos:636Info: mysql-bin.000002;pos=4

9 rows in set (0.00sec)

ERROR:

No query specified

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值