Select something with location unkown from all tables in database in mysql -


i have varchar value of foo somewhere in database , don't know exactly.

is possible create query search tables , columns content? similar grep

there isn't easy way this, use information schema find varchar columns.

select table_name, column_name  information_schema.columns data_type = 'varchar'; 

you write query produce list of queries need run search term.

select concat(     'select ', column_name,      ' ', table_name,      ' ', column_name, ' \'%foo%\'' ) stmt information_schema.columns data_type = 'varchar'; 

a more advanced example might insert matches results table along table , column names.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -