1、模糊查询表象
root@serv: ~$ mysqldump dbname $(mysql -D YOURDBNAME -Bse "SHOW TABLES LIKE 'table_pattern_%'") > /tmp/database-dump.sql
2、指定表列表导出
导出表名称:
mysql -N information_schema -e "select table_name from tables where table_schema = 'dbname' and table_name like 'sys_%'" > tables.txt 导出表:
mysqldump dbname `cat tables.txt` >> dump_file.sql
批量删除表:
mysql -NB information_schema -e "select table_name from tables where table_name like 'sys_%'" | xargs -I"{}" mysql dbname -e "DROP TABLE {}"