步驟:登陸mysql赐俗,查詢?nèi)罩編毂字@取日志信息。
---------------登陸秩彤、查詢
$ mysql -u<user-name> -p<password> -h<mysql-host>
> show binary logs;
+------------------+-----------+
| Log_name | File_size |
+------------------+-----------+
| mysql-bin.002453 | 810301 |
| mysql-bin.002454 | 525033141 |
| mysql-bin.002455 | 525567869 |
| mysql-bin.002456 | 525685856 |
| mysql-bin.002457 | 525600872 |
| mysql-bin.002458 | 525343609 |
| mysql-bin.002459 | 525320701 |
| mysql-bin.002460 | 524613083 |
| mysql-bin.002461 | 131486180 |
| mysql-bin.002462 | 44219 |
+------------------+-----------+
10 rows in set (0.00 sec)
> exit
---------------------- 獲取日志信息到本地
$ mysqlbinlog -u<user-name> -p<password> -h<mysql-host> --read-from-remote-server mysql-bin.002462 > 1.log
$ mysqlbinlog -u<user-name> -p<password> -h<mysql-host> --base64-output=decode-rows --verbose --read-from-remote-server mysql-bin.002462 > 1.log