MySQL : How to check and enable slow query logging of MySQL server on Linux

preview_player
Показать описание
MySQL : What is Slow Query Logging in MySQL Server and How to Enable it on Linux

The Slow Query Logging is used to capture the queries which do not use indexes or

they execute for long time which is defined by long_query_time.

By default the value for long_query_time is 10 seconds.

mysql show variables like '%slow%';
+---------------------------+--------------------------------+
| Variable_name | Value |
+---------------------------+--------------------------------+
| log_slow_admin_statements | OFF |
| log_slow_extra | OFF |
| log_slow_slave_statements | OFF |
| slow_launch_time | 2 |
| slow_query_log | OFF |
+---------------------------+--------------------------------+
6 rows in set (0.03 sec)

mysql show variables like '%long_query_time%';
+-----------------+-----------+
| Variable_name | Value |
+-----------------+-----------+
| long_query_time | 10.000000 |
+-----------------+-----------+
1 row in set (0.02 sec)
Рекомендации по теме
Комментарии
Автор

Superlike!! Thanks mate for your tutorial

Comunicandoqueesgerundio