如何禁用或规避 phpmyadmin 的 SQL_CALC_FOUND_ROWS
当您通过 phpmyadmin 处理 SELECT
时,它有时会在后台添加 LIMIT 0,30
,和/或抛出 SQL_CALC_FOUND_ROWS
code> 到 SELECT
中,这样它就可以告诉我如果没有 LIMIT
会有多少结果。
不幸的是,添加SQL_CALC_FOUND_ROWS
有时需要比我预期更多的处理(即比我运行原始未受污染查询更多的处理)。
是否有全局配置选项来禁用 phpmyadmin 对我的查询的修改?
我可以在每个查询的基础上使用哪些技巧来防止 phpmyadmin 的修改?
When you process a SELECT
through phpmyadmin, behind the scenes, it will sometimes add a LIMIT 0,30
, and/or it'll throw a SQL_CALC_FOUND_ROWS
into the SELECT
so it can tell me how many results there would have been without the LIMIT
.
Unfortunately, adding the SQL_CALC_FOUND_ROWS
sometimes requires much more processing than I was expecting (i.e. more than if I had ran my original untainted query).
Is there a global config option to disable phpmyadmin's modification(s) of my queries?
What tricks can I use on a per-query basis to prevent phpmyadmin's modification(s)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
快速检查一下 PHPMyAdmin 源代码后发现没有这样的代码。
但是,如果您查看文件 sql.php,并找到标记为
// not“ justbrowsing”
的else
语句。将那里和// end else "just browser"
之间的代码替换为$unlim_num_rows = 1000000;
之类的代码,您将阻止它执行计数查询,同时仍然能够浏览。(每次更新 PMA 时都必须重复此操作,您应该定期执行此操作,因为至少可以说,其安全声誉不佳)
A quick check of the PHPMyAdmin source code says there isn't one.
However, if you look in the file sql.php, and find the
else
statement labelled// n o t " j u s t b r o w s i n g "
. Replace the code between there and// end else "just browsing"
with something like$unlim_num_rows = 1000000;
you'll prevent it doing its counting query, while still being able to browse.(you'll have to repeat this each time you update PMA, which you should be doing regularly since its security reputation is not great, to say the least)