How do I split the output from mysqldump into smaller files?

前端 未结 18 1508
孤城傲影
孤城傲影 2020-11-27 13:50

I need to move entire tables from one MySQL database to another. I don\'t have full access to the second one, only phpMyAdmin access. I can only upload (compressed) sql file

18条回答
  •  攒了一身酷
    2020-11-27 14:09

    Late reply but was looking for same solution and came across following code from below website:

    for I in $(mysql -e 'show databases' -s --skip-column-names); do mysqldump $I | gzip > "$I.sql.gz"; done
    

    http://www.commandlinefu.com/commands/view/2916/backup-all-mysql-databases-to-individual-files

提交回复
热议问题