Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

viewing a binlog to see when a record was last touched in mysql

Posted on 2011-09-21
1
Medium Priority
?
234 Views
Last Modified: 2012-05-12
A record was updated today, I need to see when/who modified it the last before today's date - what would be the best way to acheive this.

b) If it is to look at the log files in this month, do I need to go file through file to look into or is there a quicker way.
0
Comment
Question by:Jsara
1 Comment
 
LVL 24

Accepted Solution

by:
johanntagle earned 2000 total points
ID: 36579229
Assuming your on a *nix machine you can make a shell script like:

for file in `ls -1 /path/to/mysql-bin.*`; do
  echo ${file}
  /usr/local/mysql/bin/mysqlbinlog ${file} | grep 'put the string you are looking for here i.e. primary_key_column=value'
done

This will let help you identify which binlog file contains the statement you are looking for.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month11 days, 12 hours left to enroll

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question