免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2590 | 回复: 4
打印 上一主题 下一主题

不解的mysql slow log 配置 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-05-10 14:59 |只看该作者 |倒序浏览
1:首先配置如下
log_slow_queries       = /var/log/mysql/mysql-slow.log
long_query_time = 2
log-queries-not-using-indexes

有如下警告

100510  2:42:59 [Warning] '--log_slow_queries' is deprecated and will be removed in a future release. Please use ''--slow_query_log'/'--slow_query_log_file'' instead.


2:这次把log_slow_queries    换成slow_query_log
slow_query_log          = /var/log/mysql/mysql-slow.log
long_query_time = 2
log-queries-not-using-indexes

换成slow_query_log,也有警告
100510  2:45:30 [Warning] options --log-slow-admin-statements, --log-queries-not-using-indexes and --log-slow-slave-statements have no effect if --log_slow_queries is not set


那我如果想启动log-queries-not-using-indexes,且不希望有警告,该怎么办?

论坛徽章:
0
2 [报告]
发表于 2010-05-10 15:04 |只看该作者
把你的配置全部贴出来。 有的配置选项已经过期了。

论坛徽章:
0
3 [报告]
发表于 2010-05-10 15:10 |只看该作者
SLOW LOG,目前整的挺复杂的,因为版本的不同,写法会不同。所以你先确定你的版本是什么再说。
  1. Control the slow query log as follows:

  2.     *

  3.       Before 5.1.6, the slow query log destination is always a file. To enable the log, start mysqld with the --log-slow-queries[=file_name] option.
  4.     *

  5.       As of MySQL 5.1.6, the destination can be a file or a table, or both. Start mysqld with the --log-slow-queries[=file_name] option to enable the slow query log, and optionally use --log-output to specify the log destination (as described in Section 5.2.1, “Selecting General Query and Slow Query Log Output Destinations”).
  6.     *

  7.       As of MySQL 5.1.12, as an alternative to --log-slow-queries, use --slow_query_log[={0|1}] to specify the initial slow query log state. In this case, the default slow query log file name is used. With no argument or an argument of 1, --slow_query_log enables the log. With an argument of 0, this option disables the log.
  8.     *

  9.       As of MySQL 5.1.29, use --slow_query_log[={0|1}] to enable or disable the slow query log, and optionally --slow_query_log_file=file_name to specify a log file name. The --log-slow-queries option is deprecated.
复制代码

论坛徽章:
0
4 [报告]
发表于 2010-05-10 15:18 |只看该作者
谢谢上帝他爷,解决了
As of MySQL 5.1.29, use --slow_query_log[={0|1}] to enable or disable the slow query log, and optionally --slow_query_log_file=file_name to specify a log file name. The --log-slow-queries option is deprecated.


slow_query_log=1
slow_query_log_file = /var/log/mysql/mysql-slow.log
long_query_time = 2
log-queries-not-using-indexes

这样就不会有警告了,

论坛徽章:
8
综合交流区版块每周发帖之星
日期:2015-12-02 15:03:53数据库技术版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每日发帖之星
日期:2015-09-14 06:20:00金牛座
日期:2014-10-10 11:23:34CU十二周年纪念徽章
日期:2013-10-24 15:41:34酉鸡
日期:2013-10-19 10:17:1315-16赛季CBA联赛之北京
日期:2017-03-06 15:12:44
5 [报告]
发表于 2010-05-10 16:55 |只看该作者
笔记一下
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP