我有一个问题,从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这可能是我的无知,但我多年来一直在导出和导入大型数据库,没有任何问题。
如有任何帮助,非常感谢。
谢谢
发布于 2016-07-29 20:48:54
尝试从mysql.exe导入数据
mysql -uuser -ppass dbName < file.sqlhttps://stackoverflow.com/questions/38659171
复制相似问题