Blogger Information
Blog 20
fans 0
comment 0
visits 33348
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
mysql日志
陈文鹏的博客
Original
948 people have browsed it

mysql> show variables like 'general_log_file';
+------------------+------------------------------------+
| Variable_name    | Value                              |
+------------------+------------------------------------+
| general_log_file | /usr/local/mysql/data/localhost.log |
+------------------+------------------------------------+
1 row in set (0.00 sec)
错误日志文件路径
mysql> show variables like 'log_error';
+---------------+------------------------------------+
| Variable_name | Value                              |
+---------------+------------------------------------+
| log_error     | /usr/local/mysql/data/localhost.err |
+---------------+------------------------------------+
1 row in set (0.00 sec)
慢查询日志文件路径
mysql> show variables like 'slow_query_log_file';
+---------------------+-----------------------------------------+
| Variable_name       | Value                                   |
+---------------------+-----------------------------------------+
| slow_query_log_file | /usr/local/mysql/data/localhost-slow.log |
+---------------------+-----------------------------------------+
1 row in set (0.01 sec)

查看蛮查询是否开启OFF代表的是关闭

mysql> show variables like 'slow_query_log';

+----------------+-------+

| Variable_name  | Value |

+----------------+-------+

| slow_query_log | OFF   |

+----------------+-------+

1 row in set (0.01 sec)

①开启慢查询

1505130216731669.jpg

②快慢时间临界点

mysql > show variables like 'long_query_time';

1505130339181621.jpg

默认是10秒,我们给它设置成1秒

③设置时间临界点

mysql > set long_query_time = 2;  

1505130420617979.jpg

设置的时候不需要加global。



Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post