MySQL has a query logging feature. In order to use it you have to first enable it.
Enabling the general query log
Step 1: Set your log file in /etc/my.cnf
In the [mysqld] section specify the general log file name:
Step 2: Create the file and make sure it is owned by the system user mysql
touch /var/log/mysqld.general.log chown mysql.mysql /var/log/mysqld.general.lo