我遇到一个问题,即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
这可能是我的无知,但我多年来一直在出口和导入大型数据库,没有任何问题。
任何帮助,感激不尽。
由于
答案 0 :(得分:0)
尝试从mysql.exe
mysql -uuser -ppass dbName < file.sql