Search text in fields in every table of a MySQL database

前端 未结 24 2074
梦谈多话
梦谈多话 2020-11-22 06:23

I want to search in all fields from all tables of a MySQL database a given string, possibly using syntax as:

SELECT * FROM * WHERE * LIKE \'%stuff%\'
         


        
24条回答
  •  我寻月下人不归
    2020-11-22 06:38

    This is the simplest query to retrive all Columns and Tables

    SELECT * FROM information_schema.`COLUMNS` C WHERE TABLE_SCHEMA = 'YOUR_DATABASE'
    

    All the tables or those with specific string in name could be searched via Search tab in phpMyAdmin.

    Have Nice Query... \^.^/

提交回复
热议问题