komlenic.com

making noise since 1977

MySQL Search And Replace

« | Thu May 15, 2008 | comments and reactions | permanent link | »

This post is more than two years old. It might be still-relevant and maybe even awesome, but it's probably outdated (and likely embarassing!) Proceed with care.

Filed under we never had a reason to do that until now, but wow is that ever useful, is this MySQL query which allows you to do a quick search and replace on a given column:

UPDATE tablename SET tablefield =
replace(tablefield,"findstring","replacestring");
blog comments powered by Disqus