The 'mysqldump' command is used to dump databases managed by MySQL. Let's consider three the most useful cases of MySQL database dumping

 

Dump Entire Database

mysqldump -u username -ppassword database_name  > the_whole_database_dump.sql

Dump only one table

mysqldump -u username -ppassword database_name table_name > single_table_dump.sql

Dump only rows with specific condition/criteria

mysqldump -u username -ppassword database_name table_name --where="date_created='2013-06-25'" > few_rows_dump.sql

Restore database

mysql -u username -ppassword database_name < few_rows_dump.sql