Search for all occurrences of a string in a mysql database

gregh picture gregh · Feb 18, 2009 · Viewed 309.7k times · Source

I'm trying to figure out how to locate all occurrences of a url in a database. I want to search all tables and all fields. But I have no idea where to start or if it's even possible.

Answer

Paolo Bergantino picture Paolo Bergantino · Feb 18, 2009

A simple solution would be doing something like this:

mysqldump -u myuser --no-create-info --extended-insert=FALSE databasename | grep -i "<search string>"