Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Logging all queries #561
Is it currently possible to log all queries to file?
I am having an issue where my application when going via proxysql (works fine going directly to mariadb) uses the wrong database in one query but I don't know what is causing it. I would like to log everything and then figure out what exactly is going on.
will cause all the queries to be logged together with a lot of metadata like destination hostgroup, execution time, etc.
added a commit
May 15, 2016
Hi @nishitm .
Yes, it is possible to log all queries to file.
This allows you to defines which queries to log, and which queries not to log, therefore to be very granular.
Queries can be read using the example tool
@renecannao I was trying to follow these instructions to log queries on CentOS 6, but am getting this when trying to compile the eventslog_reader_sample:
I tried to to download the Boost libraries to try to compile with including this:
but I get the same error.
referenced this issue
Sep 19, 2017
I am trying to log all queries to a file. Here is what i did so far
--Update global variable mysql-eventslog_filename to /tmp/psnew1.log
update global_variables set variable_value = '/tmp/psnew1.log' where variable_name = 'mysql-eventslog_filename’;
SELECT * FROM global_variables WHERE variable_name LIKE '%event%';
LOAD MYSQL VARIABLES TO RUNTIME;
--Trying to add rule to log all queries
INSERT INTO mysql_query_rules (rule_id, active, query_digest, log,apply) VALUES (1,1,'.',1,0);
Seems like query_digest column is not there in mysql_query_rules table. What is the equivalent column ?
@shanthibyesmail -- Did you load the rules from Memory to Runtime? Also don't forget to save them to disk.