Reputation: 65
Complete beginner on MySQL, have tried to find the solution by googling but got into deep rabbitholes that didn't help, like trying to read binlogs from terminal. The MySQL Manual was not accessible enough for my limited experience and knowledge. Btw the db is only running locally.
Upvotes: 1
Views: 172
Reputation: 65
You can use mysql-connector-python, and execute the following queries:
SHOW BINARY LOGS;
This will show all your binary logs. They are time-ordered so the biggest integer in the log name will mean the latest log.
SHOW BINLOG EVENTS IN "binlog.000420";
This will show events on your binlog. Pos column means Position, and will also be time-ordered so the biggest Pos means the latest event. Event_type and Info will provide valuable information for the logged events.
You can check the latest binlog and Pos by querying:
SHOW MASTER STATUS;
PS: I'm a beginner, and spent 10 hours of research before learning this stuff. So perhaps this SO question/answer might help others.
Upvotes: 1