????????????????
????[root@mysql02 data]# chmod -R 777 mysql //????????????
????[root@mysql02 data]# cd mysql
????[root@mysql02 mysql]# ll
?????????? 733220
-rwxrwxrwx. 1 root root 305 11?? 26 18:00 backup_variables.txt
-rwxrwxrwx. 1 root root 740294656 11?? 26 18:00 ibdata1
-rwxrwxrwx. 1 root root 5242880 11?? 26 18:00 ib_logfile0
-rwxrwxrwx. 1 root root 5242880 11?? 26 18:00 ib_logfile1
drwxrwxrwx. 2 root root 4096 11?? 26 18:00 john
drwxrwxrwx. 2 root root 4096 11?? 26 18:00 mysql
drwxrwxrwx. 2 root root 4096 11?? 26 18:00 performance_schema
-rwxrwxrwx. 1 root root 8488 11?? 26 18:00 server-all.cnf
-rwxrwxrwx. 1 root root 1815 11?? 26 18:00 server-my.cnf //???BKT?????
[root@mysql02 mysql]# service mysqld start //????????
????3.5 ??????????????????B
????[root@mysql02 mysql2]# pwd //???????????????binlog?????????binlog???/data/mysql2
????/data/mysql2
????[root@mysql02 mysql2]# mysqlbinlog --start-position=107 --stop-position=1203 mysql-bin.000001| mysql -uroot -p //????post??λ?y??л?????????posλ???107???????posλ???1203
Enter password:
[root@mysql02 mysql2]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.5.36-log Source distribution
Copyright (c) 2000?? 2014?? Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| BKT |
| john |
| mysql |
| performance_schema |
+--------------------+
5 rows in set (0.02 sec)
mysql> use BKT
Database changed
mysql> show tables;
+---------------+
| Tables_in_BKT |
+---------------+
| john |
+---------------+
1 row in set (0.00 sec)
mysql> select * from john;
+------+
| id |
+------+
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |
+------+
5 rows in set (0.01 sec) //????????????
????3.6 ????????????C
[root@mysql02 mysql2]# mysqlbinlog --start-date="2014-11-27 09:21:56" --stop-date="2014-11-27 09:22:33" mysql-bin.000001| mysql -uroot -p123456 //?????????????????????????????C
Warning: Using unique option prefix start-date instead of start-datetime is deprecated and will be removed in a future release. Please use the full name instead.
Warning: Using unique option prefix stop-date instead of stop-datetime is deprecated and will be removed in a future release. Please use the full name instead.
[root@mysql02 mysql2]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.5.36-log Source distribution
Copyright (c) 2000?? 2014?? Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| BKT |
| john |
| mysql |
| performance_schema |
+--------------------+
5 rows in set (0.00 sec)
mysql> use BKT
Database changed
mysql> select * from john;
+------+
| id |
+------+
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |
| 6 |
| 7 |
| 8 |
| 9 |
| 10 |
+------+
10 rows in set (0.00 sec) //??????????????????C
???????mysqlbinlog???????????????????binlog??????л????????binlog??POSλ??????????mysqlbinlog???????к?????????mysqlbinlog --help??????????????
????4.1 ??binlog???????[root@mysql02 mysql2]# mysqlbinlog mysql-bin.000001
????4.2 mysqlbinlog?????????ò?????
????-h  ??????????IP
????-P  ?????????????????????
????-server-id ?????????serverid????????????к??????
????-d  ?????????????
???????磺 [root@mysql02 mysql2]# mysqlbinlog -d BKT mysql-bin.000001 //???BKT?????????