The steps to enable mysql query logs on Mysql 5.7 (should work on other versions also) on Linux
- Edit /etc/my.cnf and add the following
general_log=1
general_log_file=/var/log/mysqlquery.log
- Ensure /var/log has write permission for mysql user
sudo chmod 777 /var/log
- Restart mysql
sudo systemctl restart mysqld