SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";给出错误 [英] SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; gives an error
问题描述
我的 mysql 数据库有问题.我无法从我的朋友那里导入数据库.我需要一些帮助.
I have problem with mysql database. I can't import a database from my friend. I need some help.
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
错误:
意外的语句开头.(在位置 0 的phpMyAdmin"附近)
无法识别的语句类型.(在位置 11 的SQL"附近)
Unexpected beginning of statement. (near "phpMyAdmin" at position 0)
Unrecognized statement type. (near "SQL" at position 11)
#1064 - 您的语法 obok 'phpMyAdmin SQL Dump
有问题SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"' w linii 1
#1064 - Something is wrong in your syntax obok 'phpMyAdmin SQL Dump
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"' w linii 1
推荐答案
你的语法没有问题,但你的文件可能有问题:很可能文件被编辑了,文本编辑器(当然是 Windows notepad.exe)太聪明了,在保存时添加了一个 BOM.
There´s nothing wrong with you syntax, but probably with your file: most likely the file was edited and the text-editor (of course Windows notepad.exe) was too clever and added a BOM on saving.
删除前 3 个字节(HEX: EF BB BF),不带它保存文件(使用十六进制编辑器或使用 PSPad 并将格式切换到 UNIX),导入器应该没有问题了.
Remove the first 3 bytes (HEX: EF BB BF), save the file without it (either use a hex editor or use PSPad and switch format to UNIX), and the importer should have no problem anymore.
BOM 愚弄了进口商,第一个 - 被吃掉了,进口商不再承认第一个评论.关于 BOM 的维基百科:
The BOM fools the importer, the first - gets eaten and the importer no longer recognizes the first comment as such. Wikipedia about BOM:
这篇关于SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";给出错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!