MYSQL Dump only certain rows

后端 未结 3 1794
天命终不由人
天命终不由人 2020-12-12 18:36

I am trying to do a mysql dump of a few rows in my database. I can then use the dump to upload those few rows into another database. The code I have is working, but it dumps

相关标签:
3条回答
  • 2020-12-12 19:17

    Use this code for specific table rows, using LIKE condition.

    mysqldump -u root -p sel_db_server case_today --where="date_created LIKE '%2018
    %'" > few_rows_dump.sql
    
    0 讨论(0)
  • 2020-12-12 19:20

    You need to quote the "where" clause.

    Try

    mysqldump --opt --user=username --password=password lmhprogram myResumes  --where="date_pulled='2011-05-23'" > test.sql
    
    0 讨论(0)
  • 2020-12-12 19:27

    Just fix your --where option. It should be a valid SQL WHERE clause, like:

    --where="date_pulled='2011-05-23'"

    You have the column name outside of the quotes.

    0 讨论(0)
提交回复
热议问题