表太多,只记得这个表有一个mygame的字段,但是并不知道这张表在那个数据库下,只能根据这个字段查找对应的表和所在数据库
select table_schema,table_name from information_schema.columns where column_name = '字段名'
演例:
mysql> select table_schema,table_name from information_schema.columns where column_name = 'gname';
查询结果:
+--------------+-------------------+
| table_schema | table_name |
+--------------+-------------------+
| ccc | mygame | # 可知道在ccc这个数据库下
| student | app01_class_grade |
+--------------+-------------------+
2 rows in set (0.36 sec)