How to reliably restore MySQL blobs

前端 未结 2 620
谎友^
谎友^ 2021-02-08 14:26

I have been backing up a MySQL database for several years with the command: mysqldump myDatabaseName -u root > myBackupFile.sql

The backups have appeare

2条回答
  •  被撕碎了的回忆
    2021-02-08 15:18

    I managed to back up and restore the blobs by using the following mysqldump command:

    mysqldump --opt  --skip-extended-insert --max_allowed_packet=128M -u root myDB > filename
    

    Not sure if it’s specifying max_allowed_packet on the command line or the skip-extended-insert that did the trick.

    I assumed that my max_allowed_packet of 32M was being used, but I think that in the mysql config file it is in the [mysqld] section and so probably does not apply to dump.

    I still don’t understand why I got no errors on either the dump or the restore.

提交回复
热议问题