kabir
kabir

Reputation: 542

How can I take MySQL dumps with some tables excluded from the database

We have a database in which one specific table gets very large very fast. When taking a dump and then restoring this database on another server, it takes a lot of time due to the large size. I want to exclude this specific table when taking the dump. Any ideas ?

Upvotes: 0

Views: 121

Answers (3)

vissi
vissi

Reputation: 2334

Most graphical clients (like phpmyadmin) give you exclusion options.

Upvotes: 0

Ike Walker
Ike Walker

Reputation: 65587

Use the --ignore-table flag.

  --ignore-table=name Do not dump the specified table. To specify more than one
                      table to ignore, use the directive multiple times, once
                      for each table.  Each table must be specified with both
                      database and table names, e.g.,
                      --ignore-table=database.table.

Upvotes: 0

Marc B
Marc B

Reputation: 360872

mysqldump has a --ignore-table option, something like:

mysqldump -p -u username nameofdatabase --ignore-table=verybigtable

Upvotes: 1

Related Questions