On Fri, 2005-07-29 at 14:00 +0200, Gregory Machin wrote: > I need search all the tables in a database for a single string. I'm > trying to figure out how, where and what other tables exponent cms > saves it text pages and references to, so i can finish writing a mass > page import module.... > > In short can mysql do a recursive search, through all the table's in > a database ..
I'm not aware of a way to do a recursive search, but I've had to solve a similar problem before. This command: grep -H --binary-files=text search_string *MYD | cut -f1 -d: | sort -u run in a database directory on a *NIX box (or Windows with Cygwin) will print out the tables that contain search_string. It takes a while, but it gives you the information you're looking for. I probably wouldn't run that on my tables if they're being written to, but I haven't had a problem (yet). -- Pat Adams Applications Programmer SYSCO Food Services of Dallas
signature.asc
Description: This is a digitally signed message part