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.
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
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:
#mysql