- Open the MySQL config file, which is located at /etc/mysql/my.cnf on Linux systems.
- Then write the following lines at the end of that file.
general_log_file = /var/log/mysql/general_mysql.log
general_log = on
Restart your MySQL server (e.g. by executing "sudo service mysql restart" on Ubuntu Linux systems). Now you can follow all new queries as they are executed by this command:
tail -f /var/log/mysql/general_mysql.log
You can leave this program in command line by pressing CTRL+C.
For disabling, just set "general_log" to "off" or comment the out the previous lines in /etc/mysql/my.cnf by writing the # character at the beginng of the lines, save and restart the MySQL server again.