简体   繁体   中英

Export from PHPMyAdmin won't import

I have a problem that an export from PHPMyAdmin won't reimport. It's something to do with a combination of an escaped single quote and an character. I have reduced it to the following:

CREATE TABLE `test` (
  `id` int(11) NOT NULL,
  `text` text NOT NULL,
  `text2` text NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

With no escaped single quote, but with an :

INSERT INTO `test` (`id`, `text`, `text2`) VALUES (108, 'Whats new for local authorities?', ' ');

WORKS OK

With an escaped single quote, but no

INSERT INTO `test` (`id`, `text`, `text2`) VALUES (108, 'What\'s new for local authorities?', '');

WORKS OK

But with both:

INSERT INTO `test` (`id`, `text`, `text2`) VALUES (108, 'What\'s new for local authorities?', ' ');

Fails with:

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

This is probably my ignorance, but I've been exporting and importing large DBs for years with no problems.

Any help, gratefully received.

Thanks

尝试从mysql.exe导入数据

mysql -uuser -ppass dbName < file.sql

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM