nnduy
for debugging the queries, the MySQL General Log is good, you can set this up in mysql config
This is in my /etc/mysql/mysql.conf.d/mysql.cnf
but the actual file might be different for you - seems to be a heap of possible places to put settings for mysql
[mysqld]
general_log_file = /var/log/mysql/mysql/log
general_log = 1
this will log out every query and have a big performance impact so you 100% do not want to have this setting on a production server