How to use mysqldump for a portion of a table?

后端 未结 7 749
自闭症患者
自闭症患者 2020-12-12 12:30

So I can export only a table like this:

mysqldump -u root -p db_name table_name > table_name.sql

Is there any way to export only a porti

7条回答
  •  无人及你
    2020-12-12 13:12

    Below query is to select from id range you can use date_created or any instead of id

    mysqldump --opt --host=dns --user=user_name --password=your_passwd db_name --tables table_name  --where "id > 1 and id < 100 " > /file_name.sql
    

    ex: --where="date_created > '2019-01-18' " --> insted of id

提交回复
热议问题