How to find a term in a mysql database?

Asked

Viewed 792 times

1

How can I search all fields of all tables in a particular mysql database? I need to find a word that I have no idea where it is.

The result would specify the name(s) (s) of the table(s) and the name(s) of the(s) field(s) where the term is.

Any idea how to do that?

  • Hello, only in mysql?

  • In my case, yes, but if you could explain to me the logic of how you actually do it in another bank, I’d be grateful...

  • I believe that answer can help, check occurrence in all fields. You can only use SQL? with a script of some language can simplify some things. In the worst case you can write a query that writes another with dynamic information.

  • Yes, in my case only the query for the bank that serves me.

  • http://answall.com/questions/122379/como-selecionar-todas-as-tabelas-que-contenham-o-campo-com-mesmo-nome

1 answer

1

Friend,

I found a person with the same doubt as yours. Take a look at this answer here: https://stackoverflow.com/questions/562457/search-for-all-occurrences-of-a-string-in-a-mysql-database#Answer-26647118

If you can’t, you could simply download your.sql database and search the file for the term you want. That would be the fastest way, in my opinion

You’re right Thiago Luiz, I’ll paste the answer I found:

In phpMyAdmin a 'Search' Feature is available:

  1. Select particular database not table.
  2. Click 'Search' tab
  3. Enter the search term you want
  4. Select the Tables you want to search in

phpMyAdmin screen shot:

phpMyAdmin Database Search tab

The 'Search' Feature is also available in Mysql Workbench:

  1. Database Menu > Search Table Data
  2. Select database and Tables you want to search (it will search in Selected Tables only)
  3. In search you can use wildChars.

Mysql Workbench screen shot:

MySQL Workbench Database Search

Browser other questions tagged

You are not signed in. Login or sign up in order to post.