sql - Why MySql query update with guid don't affect rows? -


i have mysql query update:

update wp_posts set  guid = replace (guid, 'http://oldcomain.com/', 'http://mynewcdndomain.com/') post_type = 'attachment'; 

i'm using on wordpress domain, inside amazon rds database, i'm updating via mysql workbench , there results:

0row(s) affected rows matched: 24103 changed: 0 warning: 0

as can see finds rows need, not update, i'm trying update wordpress media on wordpress cdn amazon s3 url.

update: tried:

update wp_posts set post_content = replace (post_content, 'olddocmain.com', 'newcdndomain.com') post_type = 'attachment';

doesn't work ether.

the information workbench shows can find matched records attachment, guid attribute, no rows include 'oldcomain.com/', that's why it's changing nothing.

the query using correct. think maybe verify matching characters again, e.g. 'oldcomain.com' instead of 'oldcomain.com/'.

or can try wildcard characters, try put % before , after matching characters, '%oldcomain.com%'.

hope helps.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -