You can run the mysqlbinlog command to view specific SQL statements in the binary logs of an RDS for MySQL instance.
PrerequisitesMySQL has been installed on your Linux-based on-premises host that runs a Linux operating system.
- Download data and log backup files on your Linux-based on-premises host that runs MySQL.
- Run the following command in the CLI:
mysqlbinlog -vv --base64-output=decode-rows <Save path of binary files>Note
-vv: to view SQL statements and remarks.
--base64-output=decode-rows: to decode the content.
ERROR: Error in Log_event::read_log_event(): 'Sanity check failed', data_len: 151, event_type: 35 ERROR: Could not read entry at offset 120: Error in log format or read error.
If either of the preceding errors occurs, check the version of the used mysqlbinlog command. For example, if you use Version 3.3, these errors may occur. In such case, you can upgrade the command version.
If you forget to enter
--base64-output=decode-rows, the displayed content is not decoded, as shown in the following figure.