I would like to know if it’s possible using MySQL Binary Log to record Uid’s (usernames) of the users who make modifications to the DB.
This is necessary for the audit purpose.
Is that possible?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That’s not what the binary log is for – the binary log keeps a record of all changes made to a database, usually for the purposes of replication and recovery.
A possible alternative might be the general query log, I believe that includes the username in some way.
This is all assuming you’re talking about actual connection usernames, not some arbitrary “user” in your application.
Here’s an example I just pulled from one of my logs:
As you can see, you get the connection username, and then anything with that connection ID (in this case 130) is by that user on that connection.