1 Answer
1.Enter the MySQL shell and run the following command:
set global slow_query_log = 'ON';
2 Enable any other desired options. Here are some common examples:
Log details for queries expected to retrieve all rows instead of using an index:
set global log_queries_not_using_indexes = 'ON'
Set the path to the slow query log:
set global slow_query_log_file ='/var/log/mysql/slow-query.log';
Your Answer