Enabling the general log
vi /etc/my.cnf
log=/var/log/mysqld.general.log
touch /var/log/mysqld.general.log
chown mysql.mysql /var/log/mysqld.general.log
mysql>SET GLOBAL general_log = 'ON';
/etc/init.d/mysqld restart
tail -f /var/log/mysqld.general.log
Enabling the slow query log
vi /etc/my.cnf
long_query_time = 0
slow_query_log = 1
slow_query_log_file=/var/log/mysqld.slow.query.log
touch /var/log/mysqld.slow.query.log
chown mysql.mysql /var/log/mysqld.slow.query.log
/etc/init.d/mysqld restart
tail -f /var/log/mysqld.slow.query.log
Comments
Post a Comment