General Query Log is used to keep track of mysql status i.e. it writes the information when a client connects/disconnects OR a query is executed. It is useful when the number of people managing the database is high. In order to enable ‘General Query Log’,
edit the Mysql configuration file
vi /etc/my.cnfenable the log under the ‘mysqld’ section
log=/var/log/mysql.general.logSave the file. Now create the log file and set the mysql ownership
touch /var/log/mysql.general.logNow, restart the mysql service
chown mysql.mysql /var/log/mysql.general.log
/etc/init.d/mysql restartYou can now execute the queries using phpMyAdmin OR 3rd party sql software and watch the logs
tail -f /var/log/mysql.general.log
No comments:
Post a Comment