简体   繁体   English

SQL搜索所有表的所有列

[英]SQL search all table all column

I'm trying to find a value in my SQL database, but documentation doesn't tell in which table or which column is the value. 我试图在我的SQL数据库中找到一个值,但是文档没有说明该值在哪个表或哪一列中。

All information I have is the value "use_config_gift", and I wanna look in all table of the database for finding the text. 我所拥有的所有信息都是值“ use_config_gift”,我想在数据库的所有表中查找文本。

Is this possible ? 这可能吗 ? I'm using Mysql on a terminal, and the db is a little big (560+ tables). 我在终端上使用Mysql,并且数据库有点大(560多个表)。

Anyone got an idea please ? 有人知道吗?

You can use full text search functions in MYSQL 您可以在MYSQL中使用全文本搜索功能

Kindly visit the link below for references : 请访问以下链接以获取参考:

Full text search MySQL 全文搜索MySQL

Try to use this script: 尝试使用此脚本:

http://kedar.nitty-witty.com/blog/wp-content/uploads/2009/10/find-in-all-databases-tables.sql_.txt http://kedar.nitty-witty.com/blog/wp-content/uploads/2009/10/find-in-all-databases-tables.sql_.txt

This script was written to search in all dbs but you can replace: 该脚本是为在所有数据库中搜索而编写的,但是您可以替换:

WHERE TABLE_SCHEMA NOT IN ('information_schema','test','mysql'); 在哪里TABLE_SCHEMA NOT IN('information_schema','test','mysql');

with: 与:

WHERE TABLE_SCHEMA IN ('YOUR_DB_NAME'); 在TABLE_SCHEMA IN('YOUR_DB_NAME')中;

The source : 来源 :

http://kedar.nitty-witty.com/blog/search-through-all-databases-tables-columns-in-mysql http://kedar.nitty-witty.com/blog/search-through-all-databases-tables-columns-in-mysql

Bye! 再见!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM