Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mySQL query to search all tables within a database for a string?

Is there a mySQL query to search all tables within a database?

If not can you search all tables within a database from the mySQL workbench GUI?

From phpmyadmin there's a search panel you can use to select all tables to search through. I find this super effective since magento, the ecommerce package I'm working with has hundreds of tables and different product details are in different tables.

enter image description here

like image 674
user784637 Avatar asked Sep 23 '11 00:09

user784637


People also ask

How do I search a whole MySQL database for a particular string?

If you are using MySQL Workbench, right click on the database schema and select "Search Table Data..." then fill out the form. This will search the entire database.

How do you search for a string in all fields of every table in a MySQL database?

There is a Schemas tab on the side menu bar, click on the Schemas tab, then double click on a database to select the database you want to search. Then go to menu Database - Search Data, and enter the text you are searching for, click on Start Search.

How do I see all the tables in a MySQL query?

MySQL SHOW TABLES command example To use the SHOW TABLES command, you need to log on to the MySQL server first. On opening the MySQL Command Line Client, enter your password. Select the specific database. Run the SHOW TABLES command to see all the tables in the database that has been selected.

What is the query to list all tables in database?

The easiest way to find all tables in SQL is to query the INFORMATION_SCHEMA views. You do this by specifying the information schema, then the “tables” view. Here's an example. SELECT table_name, table_schema, table_type FROM information_schema.


1 Answers

If you are using MySQL Workbench, you can do this by doing right click on the DB Schema you want to search into, and then "Search Table Data...".

In there you can select the "Search using REXEXP" option, and then type your text of search as usual. It will provide the DB rows matching your specific text.

You will need to check the "Search columns of all types" box as well.

like image 126
evaldeslacasa Avatar answered Oct 05 '22 08:10

evaldeslacasa