MySQL Query Log tutmayı aktif etme

One of the built-in tools in MySQL that you can use in optimizing your database is the “slow-query-logging” feature. This feature allows you to log slow running queries to a log file. By default, this feature is not enabled on your VPS and you will need to add a couple of lines in your “/etc/my.cnf” file (in the [mysqld] section) which I have stated below:

log-slow-queries = /var/log/mysql-slow.log
long_query_time = 5


The statements above will log queries taking longer than five second to the specified log file (/var/log/mysql-slow.log). Once finished editing your my.cnf file, restart MySQL by executing the command below:

service mysqld restart

Bir cevap yazın

E-posta hesabınız yayımlanmayacak.

Bu site, istenmeyenleri azaltmak için Akismet kullanıyor. Yorum verilerinizin nasıl işlendiği hakkında daha fazla bilgi edinin.