【发布时间】:2016-12-04 04:36:20
【问题描述】:
我有一个问题,从 PHPMyAdmin 的导出不会重新导入。这与转义单引号和字符的组合有关。我已将其简化为以下内容:
CREATE TABLE `test` (
`id` int(11) NOT NULL,
`text` text NOT NULL,
`text2` text NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
没有转义的单引号,但带有 :
INSERT INTO `test` (`id`, `text`, `text2`) VALUES (108, 'Whats new for local authorities?', ' ');
工作正常
带有转义的单引号,但没有
INSERT INTO `test` (`id`, `text`, `text2`) VALUES (108, 'What\'s new for local authorities?', '');
工作正常
但两者都有:
INSERT INTO `test` (`id`, `text`, `text2`) VALUES (108, 'What\'s new for local authorities?', ' ');
失败:
Static analysis:
1 errors were found during analysis.
Ending quote ' was expected. (near "" at position 100)
SQL query:
INSERT INTO `test` (`id`, `text`, `text2`) VALUES (108, 'What\'s new for local authorities?', ' 
MySQL said: Documentation
#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 '' ' at line 1
这可能是我的无知,但多年来我一直在导出和导入大型数据库,没有任何问题。
任何帮助,感激不尽。
谢谢
【问题讨论】:
标签: mysql phpmyadmin