mysql 5.7 general_log table has user_host but the file does not
Posted by:
Jim Graf
Date: March 02, 2018 09:41AM
(I posted this to dba.stackexchange.com, but haven't gotten any traction. This was probably the more appropriate forum. I've edited from that post)
The mysql.general_log table gives me everything I want, but I prefer the ease of a file. The output to the file specified with general_log_file works fine, but doesn't include the user_host data that the database table has.
I've read 5.4.3 The General Query Log, googled, but can't seem to find any hint of this.
Is there a format I can set that will include user_host into the file system log file? I must of missed something obvious, why wouldn't the output be exactly the same, file or table?
example of what I see in the file:
2018-03-01T15:41:45.450491Z 137300 Query SHOW COLLATION
2018-03-01T15:41:45.451280Z 137299 Query SET NAMES latin1
2018-03-01T15:41:45.451425Z 137299 Query SET character_set_results = NULL
2018-03-01T15:41:45.451554Z 137299 Query SET autocommit=1
My workaround is to generate the log in table and then "dump" the table:
mysql --user etc... -e "select user_host,argument from general_log where user_host like 'billybob%'" > junk
Subject
Written By
Posted
mysql 5.7 general_log table has user_host but the file does not
March 02, 2018 09:41AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.