Search Everywhere in MySQL

In recent months I’ve been tasked with taking over management of a web site programmed by somebody else. They used Drupal, with which I’m not familiar, and so a big part of the job is simply figuring out how that system works. In many cases I’ve wanted to search the entire database for a particular string of text, in order simply to find out where certain data is stored in the database.

I hunted over the web looking for a way to search an entire MySQL database — all tables, all fields — for text. For the most part I find forums with answers such as “Well, you set up your database wrong”. These kinds of responses remind me of the sequence in the movie “Funny Farm” where the truck driver is trying to find the town of Redbud. In short:

“Hey Mac, how do you get to Redbud?”

“If I wanted to go to Redbud, I wouldn’t start from here.”

Nonsensical and useless. If you’re here now, then this is where you’re starting from; telling me to start from somewhere else is simply a non-answer. Funny in a movie, but frustrating in real life.

Today I came across a most excellent script, the MySQL Database Search & Replace Tool. It’s a PHP page that you can drop into a web site and call from your browser. It will search the entire database for a string of text — exactly what I needed.

In a quick test run it threw out a couple errors but then gave me useful results; so it’s not entirely polished, but quite functional and useful. Kudos to Mark Jackson and Eric Amundson for releasing this great tool!

This entry was posted in 'Nuff said, Gadgets and Gewgaws, On the Front Lines and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published.