最新消息:iOS编程开发交流群(6906921) ,Mac.Cocoa开发交流群(7758675) 欢迎iOS/macOS开发编程爱好及学习者加入!

Destoon B2B 数据库replace语句快速更换新域名

CMS 天狐 12744浏览 1评论

有个朋友的destoon商务网站 需要替换个新域名

结果问题出现了 因为数据太大   好几十万条数据    数据库足足有3G 之多

用自带的数据库备份后再替换 速度慢的惊人,

导出sql 文本编辑器编辑替换 更是不显示

所以之后手写sql 替换    大部分表都替换了 (供应 求购 公司 会员 消息 附件 ) 因为有的模块没有开启所以没有写sql

oldDomain代表老域名  newDomain 代表新域名   使用时候可以用编辑器替换下  用navicat for mysql 执行  或者其他工具

MySQL Replace 替换函数语法:
update 表名 set 字段名 = replace(字段名, "字段中的旧值", "将要替换的新值");

update destoon_ad set url =
 replace(url, "oldDomain", "newDomain");

update destoon_article_21 set thumb =
 replace(thumb, "oldDomain", "newDomain");

update destoon_article_data_21 set content =
 replace(content, "oldDomain", "newDomain");

update destoon_buy set thumb =
 replace(thumb, "oldDomain", "newDomain");

update destoon_buy set thumb1 =
 replace(thumb1, "oldDomain", "newDomain");

update destoon_buy set thumb2 =
 replace(thumb2, "oldDomain", "newDomain");

update destoon_buy_data set content =
 replace(content, "oldDomain", "newDomain");

 update destoon_comment set item_linkurl =
 replace(item_linkurl, "oldDomain", "newDomain");

 update destoon_company set thumb =
 replace(thumb, "oldDomain", "newDomain");

 update destoon_company set homepage =
 replace(homepage, "oldDomain", "newDomain");

 update destoon_company set linkurl =
 replace(linkurl, "oldDomain", "newDomain");

 update destoon_company_data set content =
 replace(content, "oldDomain", "newDomain");

 update destoon_company_setting set item_value =
 replace(item_value, "oldDomain", "newDomain");

 update destoon_exhibit set thumb =
 replace(thumb, "oldDomain", "newDomain");

 update destoon_exhibit_data set content =
 replace(content, "oldDomain", "newDomain");

 update destoon_honor set thumb =
 replace(thumb, "oldDomain", "newDomain");

 update destoon_honor set content =
 replace(content, "oldDomain", "newDomain");


 update destoon_module set linkurl =
 replace(linkurl, "oldDomain", "newDomain");

 update destoon_news set linkurl =
 replace(linkurl, "oldDomain", "newDomain");

 update destoon_news_data set content =
 replace(content, "oldDomain", "newDomain");

 update destoon_page set linkurl = 
 replace(linkurl, "oldDomain", "newDomain");

 update destoon_page_data set content = 
 replace(content, "oldDomain", "newDomain");

 update destoon_message set content =
 replace(content, "oldDomain", "newDomain");

 update destoon_sell_data set content = 
 replace(content, "oldDomain", "newDomain");


 update destoon_sell set thumb = 
 replace(thumb, "oldDomain", "newDomain");

 update destoon_sell set thumb1 = 
 replace(thumb1, "oldDomain", "newDomain");

 update destoon_sell set thumb2 = 
 replace(thumb2, "oldDomain", "newDomain");


 update destoon_upload_0 set fileurl = 
 replace(fileurl, "oldDomain", "newDomain");


 update destoon_upload_1 set fileurl = 
 replace(fileurl, "oldDomain", "newDomain");


 update destoon_upload_2 set fileurl = 
 replace(fileurl, "oldDomain", "newDomain");


 update destoon_upload_3 set fileurl = 
 replace(fileurl, "oldDomain", "newDomain");


 update destoon_validate set thumb = 
 replace(thumb, "oldDomain", "newDomain");

 update destoon_validate set thumb1 = 
 replace(thumb1, "oldDomain", "newDomain");

 update destoon_validate set thumb2 = 
 replace(thumb2, "oldDomain", "newDomain");

 update destoon_link set linkurl =
 replace(linkurl, "oldDomain", "newDomain");

 update destoon_know_data set content =
 replace(content, "oldDomain", "newDomain");

 update destoon_webpage	 set content =
 replace(content, "oldDomain", "newDomain");

 update destoon_favorite set url =
 replace(url, "oldDomain", "newDomain");

 update destoon_announce set linkurl =
 replace(linkurl, "oldDomain", "newDomain");

 

转载请注明:天狐博客 » Destoon B2B 数据库replace语句快速更换新域名

微信 OR 支付宝 扫描二维码
为天狐 打赏
非常感谢你的支持,哥会继续努力!
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

网友最新评论 (1)

  1. 你辛苦了
    295012年前 (2014-05-16)回复