Short of SQL-dumping my entire database to text and searching that, is there a way to search for a specific substring in all tables of a MySQL database if you are not sure which table/record/field that substring actually occurs?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Some ideas:
You could use some external full-text search capability, such as http://www.sphinxsearch.com/
Search your binary logs. If you use statement-based logging, that should be pretty straightforward.
It would be nasty and dirty to just search the data files themselves, but that would probably work for the most part. YMMV to an extreme degree!
You could probably come up with algorithm that identifies all the text columns in all the tables, and then, as OMG points out, write some queries for those columns.
I would probably search the binary logs (assuming you have them, of course). When I am researching some database weirdness, I search our logs for some substring that is likely to be unique to the circumstances, then I can zero in on the exact statements in question.