有个朋友的destoon商务网站 需要替换个新域名
结果问题出现了 因为数据太大 好几十万条数据 数据库足足有3G 之多
用自带的数据库备份后再替换 速度慢的惊人,
导出sql 文本编辑器编辑替换 更是不显示
所以之后手写sql 替换 大部分表都替换了 (供应 求购 公司 会员 消息 附件 ) 因为有的模块没有开启所以没有写sql
oldDomain代表老域名 newDomain 代表新域名 使用时候可以用编辑器替换下 用navicat for mysql 执行 或者其他工具
MySQL Replace 替换函数语法:
update 表名 set 字段名 = replace(字段名, "字段中的旧值", "将要替换的新值");
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
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语句快速更换新域名