mysql查询失败时是否记录任何错误? [英] Is there any error logging when mysql query fails?
本文介绍了mysql查询失败时是否记录任何错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我很好奇在执行查询时MySQL数据库是否记录任何错误.我知道我打电话给 mysql_error 来检索错误,但是还有其他错误吗?登录数据库端?
I'm curious if there is any error logging by the MySQL database when I execute a query. I know that I call mysql_error to retrieve an error but is there some other logging on database side?
推荐答案
默认情况下,mysql不记录查询.但是您可以在sql配置文件中增加日志级别.尝试文件:/etc/mysql/my.cnf
并取消注释该行
By default mysql does not log queries. But you can increase the log level at the sql configuration files. Try the file: /etc/mysql/my.cnf
and uncomment the line
general_log = 1
出于性能考虑,默认情况下该功能处于关闭状态.
For performance, it is off by default.
这篇关于mysql查询失败时是否记录任何错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文