说我浏览一个php页面,我怎么知道运行什么数据库查询?我想如果我可以将所有查询记录到可以解决我的问题的.txt文件中.我试着登录,但失败了.我只想知道发送给它的查询(sql字符串).
我正在使用WinXP和Apache.
一种方法是进入my.cnf配置文件并激活常规日志.正如所暗示的那样是性能杀手,所以永远不要在生产中激活它.但是,对于开发来说完全没问题.在我的笔记本电脑上一直都在.
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
general_log_file = /var/log/mysql/mysql.log
general_log = 1
Run Code Online (Sandbox Code Playgroud)