Want fresh tech tips in your inbox?

How to Log and Query SQL Queries Hitting Your Database with MySQL

       

Here is some code just in case you want to look at and query the queries hitting your MySQL database.

Enter this from the mysql client console.

mysql> SET GLOBAL log_output = 'TABLE'
mysql> SET GLOBAL general_log = 'ON';
mysql> select event_time, argument from mysql.general_log

To stop logging you just type

mysql> SET GLOBAL general_log = 'OFF';

You can also log to a file if that is more convenient

mysql> SET GLOBAL log_output = 'FILE';
mysql> SET GLOBAL general_log_file = "/path/to/file.log";
Tagged w/ #mysql #databases #sql #logging

Apps I've Built

PhotoLocationChanger
Easily change the location on your photos and videos
Click here for more info about the app
PhotoDateChanger
Easily change the dates and times on your photos and videos
Click here for more info about the app
VocabReminder
English dictionary with notifications so you won't forget what you're studying!
Click here for more info about the app
VocabQuiz
The app that quizzes and scores you on your vocabulary!
Click here for more info about the app