Backup of all tables except one

7

In MySQL we can perform terminal backups as follows:

Database

mysqldump nomeBaseDados > meuFicheiroBackup.sql

Table

mysqldump nomeBaseDados nomeTabela > meuFicheiroBackupDaTabelaX.sql

How can I back up all tables in my nomeBaseDados database except for a tabelaCorrupta ?

    
asked by anonymous 17.10.2014 / 21:28

1 answer

7

mysqldump has a flag exactly for this:

--ignore-table 


Example Usage:

mysqldump -u username -p database --ignore-table=meubanco.tabelaCorrupta > database.sql


Remembering that, if necessary, you can use --ignore-table more than once:

mysqldump -u username -p database --ignore-table=db.tab1 --ignore-table=db.tab2 ...


See more at manual .

    
17.10.2014 / 21:32