问题
I'm receiving the following error while trying to import my DB:
ERROR at line 32769: Unknown command '\''.
I've done some searching and found that this can be because the dump was not created with the --hex-blob command.
Unfortunately, I don't have the opportunity to do that now as this was the last backup made prior to my host having an untimely raid/hardware failure.
Is there anything I can do to get my DB imported?
Update:
Tried using --force and --max_allowed_packet=1000M when importing. Here's a sample of what it returned...
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'
回答1:
Tried MySQLWorkbench and realized I forgot to add --default-character-set=utf8
during command line. Tried it again with --default-character-set=utf8
and now import works from command line too.
The command line I have is:
mysql -u <username> -pac1 <password> --default-character-set=utf8 <schema> < <dumpfile>
回答2:
DB ended up being corrupted. Was unable to recover or import.
回答3:
You will get that error if it's not an SQL
file you are trying to import. I once tried to import a tar.gz
(it had a different name and I forgot it was compressed and actually a collection of SQL files) and this error reminded me ;-)
回答4:
If all else fails, try importing with MySQLWorkbench instead of the command line, this worked for me.
来源:https://stackoverflow.com/questions/14167227/on-mysql-import-error-at-line-32769-unknown-command