简体   繁体   English

恢复另一个版本的mysqldump文件

[英]Restoring mysqldump file of another version

I am restoring a mysqldump file to another server. 我正在将mysqldump文件还原到另一台服务器。 The versions are close, so I didn't expect any problems. 这些版本已经关闭,所以我没想到会出现任何问题。 I get: 我得到:

:/var/backups$ sudo mysql -f -u root -p dbasename < backup.sql 
Enter password: 
ERROR 1064 (42000) at line 542: 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 ''  Current\n          * President/CEO at  Echoingwalls.com\n        * Develope' at line 1

Other's solutions with this error message haven't been helpful. 带有此错误消息的其他解决方案没有帮助。 How can I detect if my back up is corrupt? 如何检测我的备份是否损坏? I am pretty sure the versions of MySQL have been pretty close (both 5.x). 我很确定MySQL的版本已经非常接近(均为5.x)。

Any specific instructions on how to restore this would be appreciated. 任何有关如何还原此问题的具体说明将不胜感激。

It seems like you may have an inconsistency between how your systems are escaping single quote; 您的系统在转义单引号的方式之间似乎不一致。

... use near ''  Current\n          * Presi  ....
              ^ Note the addtional quote

Do diagnose the problem compare both tables 诊断问题比较两个表

show create table mytable

And campare the sql modes 和campare的sql模式

SELECT @@GLOBAL.sql_mode;
SELECT @@SESSION.sql_mode;

For more help find the insert statement in the dump file and post the sql. 要获得更多帮助,请在转储文件中找到插入语句并发布sql。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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