ENABLING THE MYSQL SLOW QUERY LOG

Slow queries can affect database performance and overall server performance. The slow query log feature in MySQL enables you to log queries that exceed a predefined time limit. This greatly simplifies the task of finding inefficient or time-consuming queries.

Debunking the Common Cloud Adoption Myths

To enable the slow query log in MySQL, follow these steps:

Log in to your server using SSH.

At the command line, type the following command:

mysql -u root -p

Learn MySQL

Type the MySQL root password.

To enable the slow query log, type the following command at the mysql> prompt:

SET GLOBAL slow_query_log = 'ON';

There are additional options that you can set for the slow query log:

  • By default, when the slow query log is enabled, it logs any query that takes longer than 10 seconds to run. To change this interval, type the following command, replacing X with the time in seconds:

#mysql

CrowdforThink : Blog -How to Implement MySQL Slow Query Log
1.15 GEEK