This site is still under construction! This doesn't mean that the articles are too!

MySQL Find and Replace Function

The MySQL REPLACE function is one of the most useful function MySQL has to offer. It’s great if you need to do a bulk find and replace on text in your database table. It’s very useful for migrations from one domain name to another and I have used it countless times to move Wordpress installations from a testing to a production environment to re-point images. Here the code:

UPDATE table_name SET column_name = REPLACE(column_name, 'find_string_in_quotes', 'replace_string_in_quotes');

Hope you find this useful. If you know a better way please leave a reply!

Share this:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Live
  • Twitter

Leave a Reply