Search and replace in MySQL
I recently had to help a friend go through a site and correct alot of wrong URLs. Here is an easy way to do search and replace in MySQL, for those of you who didn’t know.
If you have phpMyAdmin you can use the SQL-tab to run this query. If not, you can run it from the commandline as well. Here is the query I ran: (remember of course to replace table_name, column_name, find_this and replace_with_this with real data)
UPDATE table_name SET column_name = replace(column_name,"find_this","replace_with_this");
Technorati Tags: MySQL, databases, sql, query