简体   繁体   中英

How to fix SQL error 1064?

I've a problem, when I import the sql file after editing, it throws this error:

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 said:

#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

What should I do?

Do it like this:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM