Configure mysql to log query on file
Change the file /etc/mysql/conf.d/mysql.cnf
(require elevated privileges) adding
[mysqld]
general_log = on
general_log_file=/var/log/query
If you change the filename, keep it consistent in the following steps !