Is it possible for me to turn on audit logging on my mysql database?
I basically want to monitor all queries for an hour, and dump the log to a file.
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.
UPDATE: NO LONGER VALID FOR MYSQL 5.6+
Start mysql with the –log option:
or place the following in your
my.cnffile:Either one will log all queries to log_file_name.
You can also log only slow queries using the
--log-slow-queriesoption instead of--log. By default, queries that take 10 seconds or longer are considered slow, you can change this by settinglong_query_timeto the number of seconds a query must take to execute before being logged.