Search and Replace in MySQL

While converting a Drupal site to a Joomla site, the need to do a textual search and replace inside a MySQL-table came up. There are, of course, many ways of doing this, but the most simple way I could figure out was to use a query like this:

update the_table set the_column = replace (the_column, 'orange', 'apple');

which tells MySQL to process all rows in the table “the_table” and update the column “the_column” with the return value of the MySQL replace() function. In this example, it would replace all occurrences of “orange” with “apple”.

This query works on the whole table, one could obviously add a limiting WHERE clause to the end of the query.

This isn’t rocket science and probably old “news” to most, but perhaps someone will come across it and find it useful 🙂

Webmin 1.290

A new version of the truly amazing piece of open source software going by the name of Webmin, by Jamie Cameron, has been released. If you’re in need of flexible, powerful, and a well-designed monitoring and server management system, you need to check Webmin out.

I looked at it many many moons ago and was impressed but felt that it didn’t quite have what I needed. After a few laps in orbit, I came back to planet earth again and decided to have a look at it again, around version 1.260. I’ve been using it ever since and can only recommend it to others.

This blog isn’t the right place for Webmin’s feature list, but you’ll find all the information and resources you’d ever need on the webmin website. I’ll close by saying that it works on many operating systems, including most flavors of Linux, Unix, and Windows.