如何禁用或规避 phpmyadmin 的 SQL_CALC_FOUND_ROWS

发布于 2024-10-06 21:46:51 字数 373 浏览 5 评论 0原文

当您通过 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小糖芽 2024-10-13 21:46:51

快速检查一下 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)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文