Log In | Register | March 28, 2024

Share
 

Linux - October 17, 2011

Enable Slow Query Log for MySQL GNU / Linux

In order to enable slow query logs for MySQL on your system you would need to do the following.

1st Step is to edit your my.cnf file which is located in your /etc directory.

vi /etc/my.cnf

Once you have your my.cnf file open, then add the following 4 lines then save and exit the file.
[mysqld]
log-slow-queries
log-slow-queries=/var/log/mysql/slow-queries.log
long_query_time=1

Then create the file slow-queries.log. You can have the file in any spot you wish, as long as you define the path in your my.cnf.

touch /var/log/mysql/slow-queries.log

Change the ownership of the file to be owned by MySQL.

chown mysql.mysql /var/log/mysql/slow-queries.log

Lastly, you will need to restart mysqld for your changes to take place.

service mysqld restart

Now you should have slow query logs enabled catching any MySQL query that took longer then 1 second to process.

Post By: | FavoriteLoadingAdd to favorites

1 Comments

ロレックス 安い 時計
Tuesday, December 21, 2021

人気新作スーパーコピー財布、腕時計、雑貨、小物商店

日本的な人気と信頼を得ています。
激安、安心、安全にお届けします.品数豊富な商品情報HPはこちら!!どしどしご来店ください!!!
商品数も大幅に増え、品質も大自信です(*^v^*)
日本では手に入らない商品も、全て卸売りします。
価格、品質、自信のある商品を取り揃えておりますので、
当店の主要な経営のブランド:ヴィトン ディオール
シャネル グッチ コーチ ロレックスなど.
当店は主に経営する商品:かばん.バッグ .財布 .キーケース. 手帳.腕時計など.
当店の商品は特恵を与える。興味あれば、是非ご覧下さい
あなたが私の店まで(へ)商品を買うことを期待して、あるいは尋ねます.(*^v^*)
ロレックス 安い 時計 https://www.88kopi.com/product/product-936.html

Leave a Comment



Need Help? Ask a Question

Ask anything you want from how to questions to debug. We're here to help.

You Must Be Logged In To Post A Question.

Log In or Register