zoukankan      html  css  js  c++  java
  • mysqldump的where条件的妙用

    有时候需要从mysql数据库用mysqldump一些条数的数据记录出来,用来在测试库做一些测试之类的工作,但是mysqldump本身并没有limit字句上的支持。

    mysqldump这个命令是支持--where选项的,对于这个选项,官网给出的解释是:

     --where='where_condition'-w 'where_condition'

    Dump only rows selected by the given WHERE condition. Quotes around the condition are mandatory if it contains spaces or other characters that are special to your command interpreter.

    以前尝试过程直接将limit字句作为 --where选项的值,但是发现通不过编译,以为不支持这么做,其实是对--where选项是如何应用到mysqldump的数据查询上没有理解,今天尝试--where ' 1=1 limit 10',竟然通过了,而且给出的数据就是limit后的而结果,至少从此处看来,mysqldump是毫不犹豫的把--where选项的值直接字符串拼接到select语句后面了,恩,这就是说mysqldump是可以进行注入的,有趣。

  • 相关阅读:
    element多选下拉框的坑
    滚动条样式全局修改
    element表格自带排序的坑
    c++学习
    HTTP与TCP的区别和联系
    JSP整理
    学习目标
    mysql操作
    JAVA Date、String、Calendar类型之间的转化
    后台数据类型接收问题总结
  • 原文地址:https://www.cnblogs.com/dongyuanshi/p/7445313.html
Copyright © 2011-2022 走看看