仅在某些服务器中的MySQL查询错误 [英] Mysql Query Error only in Some Server

查看:137
本文介绍了仅在某些服务器中的MySQL查询错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将mysql转储导入到其他服务器上的新数据库. 我已经通过phpMyAdmin创建了转储.

i'm trying to import a mysql dump to a new database on a different server. I have created dump by phpMyAdmin.

当我尝试使用phpMyAdmin导入到新服务器时,旧服务器生成的某些查询返回错误.

When i try to import to new server (with phpMyAdmin), some query generated by old server return error.

例如,此查询返回错误:

This query, for example, return error:

INSERT INTO `wp_options` VALUES(324, 'CookieLawInfo-0.9', 'a:43:{s:18:"animate_speed_hide";s:3:"500";s:18:"animate_speed_show";s:3:"500";s:10:"background";s:4:"#fff";s:14:"background_url";s:0:"";s:6:"border";s:4:"#444";s:9:"border_on";b:1;s:13:"button_1_text";s:7:"Accetto";s:12:"button_1_url";s:1:"#";s:15:"button_1_action";s:27:"#cookie_action_close_header";s:20:"button_1_link_colour";s:4:"#fff";s:16:"button_1_new_win";b:0;s:18:"button_1_as_button";b:1;s:22:"button_1_button_colour";s:4:"#000";s:20:"button_1_button_size";s:6:"medium";s:13:"button_2_text";s:17:"Maggiori dettagli";s:12:"button_2_url";s:37:"https://www.webfilla.it/cookie-policy";s:15:"button_2_action";s:17:"CONSTANT_OPEN_URL";s:20:"button_2_link_colour";s:4:"#444";s:16:"button_2_new_win";b:1;s:18:"button_2_as_button";b:0;s:22:"button_2_button_colour";s:4:"#333";s:20:"button_2_button_size";s:6:"medium";s:11:"font_family";s:7:"inherit";s:10:"header_fix";b:0;s:5:"is_on";b:1;s:19:"notify_animate_hide";b:1;s:19:"notify_animate_show";b:0;s:13:"notify_div_id";s:20:"#cookie-law-info-bar";s:26:"notify_position_horizontal";s:5:"right";s:24:"notify_position_vertical";s:6:"bottom";s:14:"notify_message";s:169:"Il nostro sito fa uso di cookie per offrire una migliore esperienza di navigazione. Continuando la navigazione autorizzi l\\''uso dei cookie. [cookie_button] [cookie_link]";s:12:"scroll_close";b:0;s:19:"scroll_close_reload";b:0;s:20:"showagain_background";s:4:"#fff";s:16:"showagain_border";s:4:"#000";s:14:"showagain_text";s:24:"Privacy & Cookies Policy";s:16:"showagain_div_id";s:22:"#cookie-law-info-again";s:13:"showagain_tab";b:0;s:20:"showagain_x_position";s:5:"100px";s:4:"text";s:4:"#000";s:17:"use_colour_picker";b:1;s:12:"show_once_yn";b:0;s:9:"show_once";s:5:"10000";}', 'yes');

错误是:

应以引号结尾. (位置"1440"附近的"附近)

Ending quote ' was expected. (near "" at position 1440)

#1064-您的SQL语法有错误;检查与您的MySQL服务器版本相对应的手册,以在''a:43:{s:18:"animate_speed_hide"; s:3:"500"; s:18:"animate_speed_show"; s附近使用正确的语法: 3:第1行的"500"; s'

#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 ''a:43:{s:18:"animate_speed_hide";s:3:"500";s:18:"animate_speed_show";s:3:"500";s' at line 1

如果我尝试在localhost中执行相同的查询,则可以正常工作,而不会出现任何错误.

If i try to execute same query in localhost, this works fine without any error.

今天是我尝试修复它的第三天,没有成功.你能帮我吗?

Today is the third day that i try to fix it, without success. Can you help me?

最好的问候, 西蒙妮(Simone)

Best Regards, Simone

/-编辑---/ 谢谢scaisEdge,非常感谢您的帮助! 但是,要解决问题,关键不在于如何编辑此查询以使其正常运行,而是为什么在某些服务器中该查询已经可以工作,而在其他服务器中却不能工作?如何使同一查询在每台服务器上正常工作?

/--- EDIT ---/ Thank you scaisEdge, i really appreciate your help! However to solve problem the point is not how to edit this query to make it working, but why in some server this query already works and in some else, not? What to do to make same query working in every server?

导入文件由数百个查询组成.不可能手动编辑每个人...

Import file is made of hundreds query. Is impossible to edit every one by hand...

你有什么想法吗?谢谢!

Have you any idea? Thank you!

推荐答案

您需要将\\''替换为\',它将起作用.

You to need replace \\'' with \' and it will work.

这篇关于仅在某些服务器中的MySQL查询错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆