26 May, 2006
Find and replace text in mysql
Web Development » WordPress » Find and replace text in mysql
update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME,'find this string','replace it with this one');
26 May, 2006
Web Development » WordPress » Find and replace text in mysql
update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME,'find this string','replace it with this one');
2 | Benxamin
Oh HELL YES. Greatly appreciated.
I was pushing a WordPress site from development server to production server, and all the functions that called the ‘guid’ meta data from the page array were pointing back at the dev server.
This beats updating per line.
UPDATE wp_posts SET guid = REPLACE(guid, ‘dev.server.com’, ‘prod.server.com’);
Like a charm. Thanks again!
3 | MJ7
December 9th, 2009 at 10:34 pm
Great little function – have expanded it a little to find and replace across a whole database – http://www.mjdigital.co.uk/blog/search-and-replace-text-in-whole-mysql-database/
Perfect for moving a WordPress blog from a development server to a live server and changing the domain name
Web development, Web design, Open source technologies, Portal development, APIs, Web services, Social media applications, Search engine optimisation, Mobile application development, iPhone Apps, Web 2.0, Web 3.0, Latest Internet technologies