mysql – string replace

example: replace “www.softbeam.net/wordpress” in field “guid” with “www.softbeam.net/softbeam” for table “wp_posts” in database “softbeam”

show databases;
use softbeam;
show tables;
show fields from wp_posts;
update wp_posts set guid = replace(guid,”www.www.softbeam.net/wordpress”,”www.softbeam.net/softbeam”);

update wp_options set option_value = replace(option_value,”wordpress”,”sofbeam”);
update wp_posts set post_content = replace(post_content,”wordpress”,”softbeam”);

examples :

replace string in all records from a table :
update mytable set myfield = replace (myfield, “one”, “two”);
display a modified record set
SELECT REPLACE(myfield, ‘one’, ‘two’) from mytable;