How to search for a certain substring in all text fields of all tables in a database?

PS One-time task, software like sphinx'a do not plan to use: =)

  • And describe what problem you want to solve in this way? Perhaps there is a more economical way to not shovel the entire database. - AntonioK
  • one
    One of the database tables contains a row. This is not a malicious code. It is necessary to find in which table this row is located. - Nicholas Essen

1 answer 1

One request - no way. You can either create (by hand or shell script) on request for each table of the form SELECT * from tbl_name WHERE field1 LIKE 'string' OR field2 LIKE 'string' OR field...n LIKE 'string' and execute them in turn, or use something like phpMyAdmin - there is such functionality out of the box, it’s enough to set the string to search in the web interface.

Of course, it works wildly slowly, but you say that the task is a one-time task - well.