How Do I use mysqlbinlog to Obtain Binlog Files?
Use an ECS-based instance as an example.
- Install a MySQL client on the ECS. For details, see How Can I Install the MySQL Client?
TaurusDB is compatible with MySQL Community Edition 8.0 or later. Do not install the client of a version earlier than 8.0.
- Download binlog files.
mysqlbinlog -hxxx -uxxx -Pxxx -pxxx binlog.xxxx --read-from-remote-server
Common mysqlbinlog parameters:
- -h: database host.
- -u: username.
- -P: port number.
- -p: password.
- --start-position: position where the decoding starts.
- --start-datetime: time when the decoding starts.
- --stop-position: position where the decoding stops.
- --stop-datetime: time where the decoding stops.
- --skip-gtids: gtid_log_event is not printed.
- --short-form: Only statements are displayed.
- --result-file: The SQL file that binlog decoding results are written to.
- --read-from-remote-server: Binary logs are read from a remote server (It is available only when mysqlbinlogs and the database server are not on the same computer).