在从SQL转储恢复数据库时启用二进制模式 [英] Enable binary mode while restoring a Database from an SQL dump

查看:943
本文介绍了在从SQL转储恢复数据库时启用二进制模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对MySQL非常新,并且在Windows上运行它。我试图从MySQL中的转储文件恢复一个数据库,但我得到以下错误:

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:

$ >mysql -u root -p -h localhost -D database -o < dump.sql
ERROR: ASCII '\0' appeared in the statement, but this is not allowed unless option --binary-mode is enabled and mysql is run in non-interactive mode. Set --binary-mode to 1 if ASCII '\0' is expected. Query: 'SQLite format 3'.

我尝试过 - binary-mode 在ini文件,但它仍然给出相同的错误。我该怎么办?请帮忙。

I have tried putting --binary-mode in the ini file but it still gives the same error. What should I do? Please help.

UPDATE

正如Nick在他的评论中所建议的, $ c> $> mysql -u root -p -h localhost -D database --binary-mode -o< dump.sql 但它给了我在第1行的以下 ERROR:未知命令'\☻'。
它是一个500 Mb转储文件,当我使用gVIM查看其内容时,我可以看到的是表达式和​​数据是不可理解的。

As suggested by Nick in his comment I tried $ > mysql -u root -p -h localhost -D database --binary-mode -o < dump.sql but it gave me the following ERROR at line 1: Unknown command '\☻'. It is a 500 Mb dump file, and when I view its contents using gVIM, all I can see is expressions and data which is not comprehensible.

推荐答案

解压缩文件,然后重新导入。

Unzip the file, and then import again.

这篇关于在从SQL转储恢复数据库时启用二进制模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆