mysqldump - Dump multiple databases from separate mysql accounts to one file

后端 未结 2 1340
感情败类
感情败类 2021-02-03 10:52

The standard mysqldump command that I use is

mysqldump --opt --databases $dbname --host=$dbhost --user=$dbuser --password=$dbpass | gzip > $filename
         


        
2条回答
  •  天涯浪人
    2021-02-03 11:35

    1. For every MySQL server account, dump the databases into separate files

    2. For every dump file, execute this command:

      cat dump_user1.sql dump_user2.sql | gzip > super_dump.gz

    There is a similar post on Superuser.com website: https://superuser.com/questions/228878/how-can-i-concatenate-two-files-in-unix

提交回复
热议问题