- Instant help with your Sql coding problems

Backup only certain rows from MySQL database

Question:
How to backup only certain rows from MySQL database?
Answer:
mysqldump -u testuser -p testdb events --where="event_date>='2020-06-01' AND event_date<='2020-08-31'" > /tmp/backup_filtered.sql
Description:

If you want to export only certain rows from a MySQL database using mysqldump , you can select the records using the --where option. 

It dumps 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.

Share "How to backup only certain rows from MySQL database?"