Enable binary mode while restoring a Database from an SQL dump

后端 未结 17 1630
耶瑟儿~
耶瑟儿~ 2020-12-07 14:41

I am extremely new to MySQL and am running it on Windows. I am trying to restore a Database from a dumpfile in MySQL, but I get the following error:

$ >m         


        
17条回答
  •  离开以前
    2020-12-07 15:11

    I had this error once, after running mysqldump on Windows PowerShell like so:

    mysqldump -u root p my_db --no-data --no-create-db --no-create-info --routines --triggers --skip-opt --set-gtid-purged=OFF > db_objects.sql
    

    What I did was change it to this (pipe instead to Set-Content):

    mysqldump -u root p my_db --no-data --no-create-db --no-create-info --routines --triggers --skip-opt --set-gtid-purged=OFF | Set-Content db_objects.sql
    

    And the problem went away!

提交回复
热议问题