如何修复SQL错误1064?

时间:2016-10-07 00:11:59

标签: mysql sql syntax-error mysql-error-1064

我遇到问题,当我在编辑后导入 sql 文件时,会抛出此错误:

ErrorStatic analysis:2 errors were found during analysis.Unexpected
character. (near "" at position 0)Unexpected beginning of statement. 
(near "" at position 0)SQL query: SET SQL_MODE =
"NO_AUTO_VALUE_ON_ZERO"

MySQL 说:

#1064 - 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 ' SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"' at line 1

我该怎么办?

1 个答案:

答案 0 :(得分:0)

这样做:

SET @SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
select @SQL_MODE;