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-语法错误'phpMyAdmin SQL转储
SET SQL_MODE ="NO_AUTO_VALUE_ON_ZERO"'进入第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个字节(十六进制:EF BB BF),不带文件保存文件(使用十六进制编辑器或PPSad并将格式切换为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屋!