MYSQL enables slow query log, Enabling the Slow Query Log for MySQL or MariaDB can be a useful gadget to divide performance and capability issues affecting your worker. By observing requests that are particularly postponed in their completion, you can address them by recreating the application that triggers your inquiries. You can in like manner change the requests themselves to ensure that they are created as capably as could truly be anticipated.
For additional information about the MySQL moderate request log, read the MySQL 5.7 Reference Manual: The Slow Query Log documentation.
MYSQL enable slow query log, Moderate inquiries can impact database execution and all-around specialist execution. The slow inquiry log remembers for MySQL enables you to log requests that outperform a predefined time limit. This uncommonly deals with the task of sorting out inefficient or drawn-out requests.
To engage the slow request sign in MySQL, follow these methods:
MySQL - u root - p
SET GLOBAL slow_query_log = 'ON';
Normally, when the inactive inquiry log is engaged, it logs any request that takes longer than 10 seconds to run. MYSQL enables a slow query log, to change this stretch, type the going with the request, displacing X with the time immediately:
SET GLOBAL long_query_time = X;
Normally, the dormant inquiry log record is arranged at/var/lib/mysql/hostname-slow.log. To change the log way or filename, type the going with the request, overriding way with the way to the record, and filename with the name of the log filename:
SET GLOBAL slow_query_log_file = '/way/filename';
SELECT SLEEP(X);
The relaxed request log record should contain information about the inquiry.
SET GLOBAL slow_query_log = 'OFF';
Conclusion
MYSQL enables a slow query log, you have to simply engage the slow request log anyway long explore execution issues.