Sunday, February 5, 2023

MYSQL::TO read binary logs content by mysqlbinlog to text file#to see what query executed for auditing or issue finding by mysqlbinlog reading

 TO read binary logs content by mysqlbinlog to text file:

Working steps: @mysql 8.0.20

**Copy binary log file to some other server and then generate scripts.

--Place above binary log file to Path:C:\Program Files\MySQL\MySQL Server 8.0\bin> and try below 

 C:\Program Files\MySQL\MySQL Server 8.0\bin>mysqlbinlog DBSERVERNAME-bin.007127  --base64-output=DECODE-ROWS --verbose > C:\Temp\statements_latestone.sql

C:\Program Files\MySQL\MySQL Server 8.0\bin>mysqlbinlog DBSERVERNAME1-bin.000056 > C:\Temp\statements.sql

DBSERVERNAME-bin.007127

C:\Program Files\MySQL\MySQL Server 8.0\bin>mysqlbinlog DBSERVERNAME-bin.007127  --base64-output=DECODE-ROWS --verbose > C:\Temp\statements_latestone.sql

--base64-output=DECODE-ROWS --verbose

C:\Program Files\MySQL\MySQL Server 8.0\bin>

##########################################################################

--Place above binary log file to Path:

C:\Program Files\MySQL\MySQL Server 8.0\bin> and try below 

C:\Program Files\MySQL\MySQL Server 8.0\bin>mysqlbinlog DBSERVERNAME1-bin.000057 --base64-output=DECODE-ROWS --verbose  > C:\Temp\statements_latest11.sql

--To filter binary logs based on issue start time and stop time.

C:\Program Files\MySQL\MySQL Server 8.0\bin>mysqlbinlog DBSERVERNAME1-bin.000057 --start-datetime "2022-08-30 08:13:00" --stop-datetime "2022-08-30 13:15:00" --base64-output=DECODE-ROWS --verbose  > C:\Temp\statements_latest12.sql


C:\Program Files\MySQL\MySQL Server 8.0\bin>mysqlbinlog DBSERVERNAME1-bin.000057 --base64-output=DECODE-ROWS -vv  > C:\Temp\statements_latest13.sql


C:\Program Files\MySQL\MySQL Server 8.0\bin>mysqlbinlog DBSERVERNAME1-bin.000057 --base64-output=DECODE-ROWS -vv  > C:\Temp\statements_latest13.sql


C:\Program Files\MySQL\MySQL Server 8.0\bin>mysqlbinlog DBSERVERNAME1-bin.000057 --start-datetime "2022-08-30 08:13:00" --stop-datetime "2022-08-30 13:15:00" --base64-output=DECODE-ROWS -vv  > C:\Temp\statements_latest14.sql


C:\Program Files\MySQL\MySQL Server 8.0\bin>

########################################################################


No comments:

Post a Comment

MYSQL::Setting Validate_Password componet for MySQL Database to ensure password policy settings

Inadequate Password Settings for MySQL Database We observed that the `validate_password%` settings on hostname `<insert hostname>` a...