【问题标题】:Export from PHPMyAdmin won't import从 PHPMyAdmin 导出不会导入
【发布时间】: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?', '&nbsp

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 ''&nbsp' at line 1

这可能是我的无知,但多年来我一直在导出和导入大型数据库,没有任何问题。

任何帮助,感激不尽。

谢谢

【问题讨论】:

标签: mysql phpmyadmin


【解决方案1】:

尝试从mysql.exe导入数据

mysql -uuser -ppass dbName < file.sql

【讨论】:

  • PHPMyAdmin 有时不会导入它导出的相同数据。
  • PHPMyAdmin 不能很好地处理转义字符,即使它以这种格式导出它们。
  • 该死的,我不得不使用我忠实的 HeidiSQL。从 PhpMyAdmin 导出表格后,我之前遇到过问题,但直到今天已经有一段时间了 :)
猜你喜欢
  • 2017-01-05
  • 2012-07-13
  • 2021-02-13
  • 2011-05-08
  • 1970-01-01
  • 2012-09-07
  • 2020-02-20
  • 2019-07-01
  • 2012-12-05
相关资源
最近更新 更多