更新时间:2023-02-26 09:50:38
来自此帖子:
SET GLOBAL SQL_MODE=ANSI_QUOTES;
我个人进行测试时,必须这样做:
Personally when I tested, I had to do it like this:
SET SQL_MODE=ANSI_QUOTES;
我认为没有其他办法.
http://dev.mysql .com/doc/refman/5.0/en/server-sql-mode.html#sqlmode_ansi_quotes
将"作为标识符引号字符(例如`"引号) 字符),而不是字符串引号字符.您仍然可以使用`" 在启用此模式的情况下引用标识符.启用ANSI_QUOTES后, 您不能使用双引号引起来的文字字符串, 因为它被解释为标识符.
Treat """ as an identifier quote character (like the "`" quote character) and not as a string quote character. You can still use "`" to quote identifiers with this mode enabled. With ANSI_QUOTES enabled, you cannot use double quotation marks to quote literal strings, because it is interpreted as an identifier.