dr_dumb99 — 2007-05-15T13:23:53-04:00 — #1
I want to search a string in whole database [not in a table]? Is it possible in MYSQL? If so then how?
Thanks in advance
longneck — 2007-05-15T15:31:21-04:00 — #2
rolfen — 2010-03-17T16:31:09-04:00 — #3
Use mysqldump to dump the database into a text file, like this:
mysqldump.exe databasename -u username -p > "c:\\databasedump.sql"
Then search using a good text editor.
If you're on linux, you can pipe the output to grep and/or awk and all that stuff too.
PS: this will only work if the string is cleartext. (not encrypted or encoded in a strange way)
mj7 — 2010-03-17T17:24:38-04:00 — #4
As it looks like this topic has been bumped I'll add another way of doing this.
I have written a PHP script which allows you to find and replace (or just find) any text string across a complete MySQL database. You can view/downlaod the code here:
I am working on a way to incorporate Wildcards and regular expressions - if you're desperate for that functionality then let me know.