HeatWare.net header image
HeatWare.net
TwitterRSSEmail
  • Home
  • Windows
    • Windows 8
    • Windows 7
    • Windows Vista
    • Windows XP
  • Linux/Unix
  • Mac
  • Mobile
    • Android
    • iOS
    • Phones (Help / Resources)
  • Software / Programming
    • Free Software
    • Programming – General
    • PHP
    • Ruby/Rails
    • Quality Assurance (QA)
    • Software – General
    • Software Help
    • Databases
  • Cool Websites
  • Other
    • Deals & Bargains
    • News
    • Video Games
    • Hardware
    • Electronics
  • About

2 comments / May 6, 2014 / sood / Databases

MySQL 5.6 – How to log slow queries (Linux)

In MySQL 5.6, they introduced a different way for logging slow queries compared to previous versions. This article will show you how to quickly, and correctly enable the slow query log which is extremely useful for debugging application performance issues.

Enable Slow Query Log in MySQL 5.6

  1. Login to your MySQL host
  2. Open the my.cnf file in your favorite text editor:vi /etc/my.cnf
  3. Add the following properties:
    long_query_time=1
    slow_query_log=1
    slow_query_log_file="/var/log/mysql/log-slow-queries.log"

    long_query_time – Defines the minimum threshold for the “slow query” designation. 1 means log all queries that take more than 1s to executeslow_query_log – Value of 1 means enable. 0 means disableslow_query_log_file – Log file path. This path generally be at the same location as mysql-error.log
  4. Reload the MySQL configuration (will not cause an interruption)
    service mysql reload

Related Posts

  • Create a compressed MySQL database dump/backup (Linux)
  • How to find (log) slow queries in PostgreSQL 8.x, 9.x
  • How to see active SQL queries and open connections in Postgres?
  • Useful tips for PHP developers using MySQL
  • Solved! Installing mysql gem - extconf.rb failed error

mysql

2 comments… add one
  1. Şahin SOLMAZ December 25, 2014, 3:55 am

    # service mysqld reload

  2. Rick James September 3, 2016, 3:37 pm

    I’m pretty sure there is no way to reload the configuration file without restarting mysqld.

Cancel reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

  • Why You Should Consider Diving Apps
  • How to Buy a Smartphone that Fits Your Budget
  • How to Overcome Frustrating PDF Stress
  • Convert PDF to Word: Easy, Reliable and Quality Conversion
  • PDF to Excel App ­ – A New Way of Handling Tricky Documents

Recent Comments

  • Valarie Walter on Basic Troubleshooting Steps for your Cell Phone
  • John Mists on A Brief History of Android OS
  • syarif on PostgreSQL: How to reload config settings without restarting database
  • Raghu on How to SSH to a server using Ruby – Part I
  • francisco clemente on Basic Troubleshooting Steps for your Cell Phone

Tags

ACSLS Android Bargain Cell Phones Cool Software Cool Websites Databases Deals Ebooks Facebook Free Software G2x Galaxy S5 iOS iPhone Kindle LG Linux Linux/Unix Mac Mobile mysql Office OpenStack OS X PHP Postgres PostgreSQL ruby Samsung Galaxy S6 Shell Smartphones Sun T-Mobile Tips Tips & Tricks Ubuntu Unix Virtualization VMWare Windows Windows 7 Windows 8 Windows Vista Windows XP

Latest Tweet

Follow @HeatwaredotNet

SP
@HeatwaredotNet

  • Why You Should Consider Diving Apps https://t.co/Is41cdUv2I #diving-apps
    about 6 years ago

All Categories

Other Links

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Copyright © 2015 — HeatWare