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,079
  • 4
  • 42
  • 40
  • @Mat - Is mysqldump the only way to backup tables in MySQL? If not, this question should stand as a more general version of what you linked to. – Nick Chammas Sep 30 '13 at 14:51
  • @NickChammas: that's the "built-in" backup tool that comes with the database itself. (There are of course a host of third-party backup solutions.) – Mat Sep 30 '13 at 14:54

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,526
  • 6
  • 24
  • 38