I need to find and replace links via mysql: all instances of "https://www.scribd.com/doc/uniquenumber/nameofthedocument" to "https://www.hrnerr.org/doc/?doc=uniquenumber"?
I know that mysql doesn't do wildcards so maybe there's better method. There are 169 instances of the scribd (old) location that needs to be replaced with the new location.
UPDATE wp_whaz19_posts SET `post_content`
= REPLACE (`post_content`,
"https://www.scribd.com/doc/257828321/Piermont-Marsh-Fact-Finding-Meeting- 3-Summary-010715",
"https://www.newlink.org/doc/?doc=257828321");
or in other words;
UPDATE wp_whaz19_posts SET `post_content`
= REPLACE (`post_content`,
"https://www.scribd.com/doc/*",
"https://www.newlink.org/doc/?doc=*");
答案 0 :(得分:1)
如果您的旧网址和新网址已按上述方式修复,则可以为您完成以下任务:
更新wp_whaz19_posts SET post_content
= REPLACE(左{(1}},LOCATE('/',post_content
,28)-1),'https://www.scribd.com/doc/','{{3} }')