我遇到一个问题,从 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.exe
导入数据
mysql -uuser -ppass dbName < file.sql
关于mysql - 从 PHPMyAdmin 导出不会导入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38659171/