1. 程式人生 > >mysql database:binlog server

mysql database:binlog server

[[email protected] ~]# su - mysql

[[email protected] ~]$ mkdir binlogbackup

[[email protected] ~]$ mysqlbinlog -R --raw --host=192.168.1.201 --user=root --password=abcd.1234 --port=3306 \
--stop-never mysql-bin.000091 -r /home/mysql/binlogbackup/

[
[email protected]
 ~]$ cd binlogbackup [[email protected] binlogbackup]$ ll -h total 1.9G -rw-rw---- 1 mysql mysql 513M Nov 22 09:34 mysql-bin.000091 -rw-rw---- 1 mysql mysql 513M Nov 22 09:34 mysql-bin.000092 -rw-rw---- 1 mysql mysql 513M Nov 22 09:35 mysql-bin.000093 -rw-rw---- 1 mysql mysql 398M Nov 22 09:37 mysql-bin.000094 -R, --read-from-remote-server: read binary logs from a mysql server.  --raw: requires -R. output raw binlog data instead of sql -h, --host=name: get the binlog from server. -u, --user=name: connect to the remote server as username. -p, --password: password to connect to remote server. -P, --port=#: port number to use for connection --stop-never: wait for more data from the server instead of stopping at the end of the last log.  -r, --result-file=name: direct output to a given file. with --raw this is a prefix for the file names.