Another example for ignoring multiple tables
/usr/bin/mysqldump -uUSER -pPASS --ignore-table={db_test.test1,db_test.test3} db_test> db_test.sql
using --ignore-table
and create an array of tables, with syntaxs like
--ignore-table={db_test.table1,db_test.table3,db_test.table4}
Extra:
Import database
# if file is .sql
mysql -uUSER -pPASS db_test < backup_database.sql
# if file is .sql.gz
gzip -dc < backup_database.sql.gz | mysql -uUSER -pPASSWORD db_test
Simple script to ignore tables and export in .sql.gz to save space
#!/bin/bash
#tables to ignore
_TIGNORE=(
my_database.table1
my_database.table2
my_database.tablex
)
#create text for ignore tables
_TDELIMITED="$(IFS=" "; echo "${_TIGNORE[*]/#/--ignore-table=}")"
#don't forget to include user and password
/usr/bin/mysqldump -uUSER -pPASSWORD --events ${_TDELIMITED} --databases my_database | gzip -v > backup_database.sql.gz
Links with information that will help you
Note: tested in ubuntu server with mysql Ver 14.14 Distrib 5.5.55