dto52236 2015-06-22 08:31
浏览 38

我如何知道错误日志中MySQL在慢速查询中遇到的页面

How can i know the page from where slow query was hitting in MySQL, like

"SELECT * FROM Users WHERE id=123"

Lets say this query was written on page user.php and on many other pages and this query caught in slow log

Now i need to know the exact page on which this was run from error log

  • 写回答

1条回答 默认 最新

  • douwei3863 2015-06-22 21:33
    关注

    Grep your source code for SELECT * FROM Users WHERE id=.

    Change the PHP code to include a comment (/*...*/) in each SELECT to say where it came from. (If the slowlog strips comments, then add on AND 'page5'='page5' as a harmless, but useful, bit of info.)

    评论

报告相同问题?

悬赏问题

  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿