Mysqldump only tables with certain prefix / Mysqldump wildcards?

后端 未结 9 2542
一个人的身影
一个人的身影 2020-12-07 07:37

I have this huge, messy database I am cleaning up. It houses 500+ tables, which is the result of combining Magento Enterprise with Joomla in one single DB.

To make t

9条回答
  •  一个人的身影
    2020-12-07 08:01

    Here is an easy way:

    mysql [dbname] -u [username] -p[password] -N -e 'show tables like "bak\_%"' | xargs mysqldump [dbname] -u [username] -p[password] > [dump_file]
    

提交回复
热议问题