Mysqldump only tables with certain prefix / Mysqldump wildcards?

后端 未结 9 2534
一个人的身影
一个人的身影 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:10

    My solution:

    mysqldump -u username -p mydatabase `mysql -B --disable-column-names -u username -p mydatabase -e "SHOW TABLES LIKE 'bak\_%'" | sed ':a;N;$!ba;s/\n/ /g'`
    

提交回复
热议问题