snippetsqlMajor
How to Log All mysql queries into log file?
Viewed 0 times
filelogallintomysqlhowqueries
Problem
I am using Mysql 5.6.12 under Wamp server environment. Now I want to log All queries into ".log" file, the queries which are running by PHP or from PHPMyAdmin, I want to log them...
Solution
[mysqld]
# Set Slow Query Log
long_query_time = 1
slow_query_log = 1
slow_query_log_file = /usr/log/slowquery.log
log_queries_not_using_indexes = 1
#Set General Log
general_log = on
general_log_file=/usr/log/general.logNote that enabling
general_log on a production server has overhead you should avoid it. You can check problematic queries from slow log.Code Snippets
[mysqld]
# Set Slow Query Log
long_query_time = 1
slow_query_log = 1
slow_query_log_file = /usr/log/slowquery.log
log_queries_not_using_indexes = 1
#Set General Log
general_log = on
general_log_file=/usr/log/general.logContext
StackExchange Database Administrators Q#62129, answer score: 23
Revisions (0)
No revisions yet.