How can we only log the complete list of insert and update queries executed in mysql
Asked
Active
Viewed 792 times
1
-
https://dev.mysql.com/doc/refman/8.0/en/query-log.html check out this. – Anshuman Sharma Jul 12 '18 at 10:30
-
take a look https://stackoverflow.com/questions/303994/log-all-queries-in-mysql – munsifali Jul 12 '18 at 10:34
-
I have these configurations. But it generates all queries. I want to only log INSERT and UPDATE queries. Is it possible – Rakhitha Nimesh Jul 12 '18 at 10:41
1 Answers
0
Start mysql with the --log option:
mysqld --log=log_file_name or place the following in your my.cnf file:
log = log_file_name Either one will log all queries to log_file_name.
You can also log only slow queries using the --log-slow-queries option instead of --log. By default, queries that take 10 seconds or longer are considered slow, you can change this by setting long_query_time to the number of seconds a query must take to execute before being logged.

kiran gadhe
- 733
- 3
- 11
-
Can you explain which part of this configuration specifies only to log insert and update queries. – Rakhitha Nimesh Jul 12 '18 at 15:35