5

我在尝试导入我的数据库时收到以下错误:

第 32769 行的错误:未知命令“\”。

我做了一些搜索,发现这可能是因为转储不是使用 --hex-blob 命令创建的。

不幸的是,我现在没有机会这样做,因为这是在我的主机出现不合时宜的突袭/硬件故障之前进行的最后一次备份。

我可以做些什么来导入我的数据库吗?

更新:

导入时尝试使用 --force 和 --max_allowed_pa​​cket=1000M。这是它返回的示例...

ERROR at line 32769: Unknown command '\"'.
ERROR at line 32769: Unknown command '\"'.
ERROR 1064 (42000) at line 32769: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '}',1,1352344791,0),('performanceCache','',0,1317594187,0),('promenu','a:1:{s:7:\' at line 1
ERROR 1064 (42000) at line 32769: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'a:7:{i:9' at line 1
ERROR at line 32769: Unknown command '\"'.
ERROR at line 32769: Unknown command '\"'.
ERROR 1064 (42000) at line 32769: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'a:19:{s:10:\"promenu_id\"' at line 1
ERROR at line 32769: Unknown command '\"'.
ERROR at line 32769: Unknown command '\"'.
ERROR 1064 (42000) at line 32769: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's:1:\"9\"' at line 1
ERROR at line 32769: Unknown command '\"'.
ERROR at line 32769: Unknown command '\"'.
ERROR 1064 (42000) at line 32769: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's:13:\"promenu_title\"' at line 1
ERROR at line 32769: Unknown command '\"'.
ERROR at line 32769: Unknown command '\"'.
ERROR 1064 (42000) at line 32769: You have an error in your SQL syntax; check th                                                                                                             line 1
ERROR at line 32769: Unknown command '\"'.
ERROR at line 32769: Unknown command '\"'.
ERROR 1064 (42000) at line 32769: You have an error in your SQL syntax; check th                                                                                                             iption\"' at line 1
ERROR at line 32769: Unknown command '\"'.
ERROR at line 32769: Unknown command '\"'.
ERROR 1064 (42000) at line 32769: You have an error in your SQL syntax; check th
ERROR at line 32769: Unknown command '\"'.
ERROR at line 32769: Unknown command '\"'.
ERROR 1064 (42000) at line 32769: You have an error in your SQL syntax; check th                                                                                                             ' at line 1
ERROR at line 32769: Unknown command '\"'.
ERROR 1064 (42000) at line 32769: You have an error in your SQL syntax; check th
/*!40000 ALTER TABLE `cache_store` ENABLE KEYS */' at line 1
ERROR at line 682781: Unknown command '\''.
ERROR at line 682781: Unknown command '\''.
ERROR at line 682781: Unknown command '\''.
ERROR at line 682781: Unknown command '\''.
ERROR 1153 (08S01) at line 682781: Got a packet bigger than 'max_allowed_packet'
4

4 回答 4

3

尝试了 MySQLWorkbench 并意识到我忘记--default-character-set=utf8在命令行中添加。再次尝试--default-character-set=utf8,现在也从命令行导入作品。

我的命令行是:

mysql -u <username> -pac1 <password> --default-character-set=utf8 <schema> < <dumpfile>
于 2014-07-04T17:09:05.400 回答
0

DB最终被损坏了。无法恢复或导入。

于 2013-01-08T21:27:51.760 回答
0

如果一切都失败了,请尝试使用 MySQLWorkbench 而不是命令行导入,这对我有用。

于 2013-10-15T16:16:20.400 回答
0

如果它不是SQL您尝试导入的文件,您将收到该错误。我曾经尝试导入一个tar.gz(它有一个不同的名称,我忘记它是压缩的,实际上是一个 SQL 文件的集合),这个错误提醒了我 ;-)

于 2013-09-18T23:43:18.927 回答