本文介绍了mysql中的重复键错误由group()上的count(*)触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我正在读一本有关盲目SQL注入的无书

hi every one i was reading a sans book about blind sql injection

这本书的作者提到,如果您想在mysql中触发错误

the author of the book mention that if you want to trigger an error in mysql

使用此查询并将其注入目标

use this query and inject it in the target

1 and (select 1 from (select count(*),concat(/*your malicious query here*/,floor(rand(0)*2)x from users group by x) a)

他说(作者)group by "floor(rand(0)*2)"上的count(*)会导致内部表中的重复键并显示键

and he says (author) that count(*) on a group by "floor(rand(0)*2)" causes a duplicate key in internal table and display the key

我的问题:首先,为什么他把x放在那里?

My questions:first why he put the x there ?

第二次是内部表错误中的重复键,什么查询导致了它,然后是另一个,以及group by "floor(rand(0)*2)"上的count(*)如何导致它发生

second what is duplicate key in internal table error and what query causes it other then this one and how count(*) on a group by "floor(rand(0)*2)" causes it to happen

推荐答案

x是表达式floor(rand(0)*2)的别名,因此可以作为GROUP BY x中的引用.

x is an alias for the expression floor(rand(0)*2), so it can be references in GROUP BY x.

内部表中的重复键"听起来像是在尝试处理此查询时发生的MySQL错误的描述.

"duplicate key in an internal table" sounds like a description of a MySQL bug that occurs when it's trying to process this query.

这篇关于mysql中的重复键错误由group()上的count(*)触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 06:10