巧用MySQL log调试程序

jackxiang 2010-7-4 10:47 | |
打开my.ini文件

在[mysqld]的下面加上
log = c:/mysql_query.log.txt
重启mysql

以后你用可以用editplus查看你运行的sql了,不用在程序里一句句的用log打出来了.

附:Mysql Doc:
http://dev.mysql.com/doc/mysql/en/Log_Files.html
Log File  Types of Information Logged to File
The error log  Logs problems encountered starting, running, or stopping mysqld.
The isam log  Logs all changes to the ISAM tables. Used only for debugging the isam code.
The query log  Logs established client connections and executed statements.
The update log  Logs statements that change data. This log is deprecated.
The binary log  Logs all statements that change data. Also used for replication.
The slow log  Logs all queries that took more than long_query_time seconds to execute or didn't use indexes.

来源:gaston的博客http://blog.csdn.net/rf_wu/archive/2004/11/13/179756.aspx

作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:http://jackxiang.com/post/3272/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!

评论列表
发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]