免费注册 查看新帖 |

Chinaunix

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

mysql日志类型与普通查询日志 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-01-31 14:43 |只看该作者 |倒序浏览
在mysql-refman中有详细说明。这里纪录仅仅供newbie参考。

有4种类型的日志:
1)The error log Problems encountered starting, running, or stopping mysqld
2)The general query log Established client connections and statements received from clients
3)The binary log All statements that change data (also used for replication)
4)The slow query log All queries that took more than long_query_time seconds to execute or didn't use in

通常情况下为了调试我们的应用程序是否提供了正确的查询语句,只需要把general query log选项打开即可。
涉及到的几个命令如下(@RHEL, for MySQL-5.0.27):

// 启动mysql服务,带日志选项
service mysql start --log

// 查询日志
tail -f /var/lib/mysql/myserver.log

论坛徽章:
0
2 [报告]
发表于 2007-01-31 16:02 |只看该作者
在mysql-refman中有详细说明。这里纪录仅仅供newbie参考。
有心了 ^_^
今天刚刚看了《MySQL5权威指南》中日志方面的内容。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP