0

Is it possible to take backup of certain table in mysql? Suppose I have 10 tables, and I want to take a backup of 8 tables through one command.

How can I do this?

Mat
  • 10,289
  • 4
  • 43
  • 40

2 Answers2

0
mysqldump -u username -p databasename table1 table2 table3

or

mysqldump --opt -u username -p databasename table1 table2 table3

Arka Bhattacharjee
  • 153
  • 1
  • 1
  • 9
0

Either you can backup the required tables only in you dump by following command

mysqldump -uuser -ppassword databasename tabletoinclude1 tabletoinclude2... table2include8 > location/fileName.sql

Or you can exclude certain tables from dump by ignore-table option.

mysqldump -uuser -ppassword --ignore-table=db_name.table9 --ignore-table=db_name.table10 db_name > location\fileName.sql
Praveen Prasannan
  • 1,546
  • 6
  • 25
  • 38