- 论坛徽章:
- 0
|
在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 |
|