Heim  >  Artikel  >  Backend-Entwicklung  >  php mysql中这种怎么查

php mysql中这种怎么查

WBOY
WBOYOriginal
2016-06-23 13:39:28797Durchsuche

前提:有一个字段名为abc的在数据库中某张表里,但是忘了该表叫啥名了,并且数据库里有几百张表,不可能一个一个的找吧,所以这时需求来了
如何快速找出这个字段所在的表呢


回复讨论(解决方案)

如果你的数据库是在MYSQL 5.0之后的版本可以通过information_schema库来实现:

use information_schema;
select * from columns where column_name='查找字段名' ;

如果你的数据库是在MYSQL 5.0之后的版本可以通过information_schema库来实现:

use information_schema;
select * from columns where column_name='查找字段名' ;



你说的这个information_schema库在哪里,我用的是可视化数据库软件navicat软件,这个软件中如何调出你说的这个库呢


如果你的数据库是在MYSQL 5.0之后的版本可以通过information_schema库来实现:

use information_schema;
select * from columns where column_name='查找字段名' ;



你说的这个information_schema库在哪里,我用的是可视化数据库软件navicat软件,这个软件中如何调出你说的这个库呢

如果有权限的话,navicat直接可以看到这个库的,



如果你的数据库是在MYSQL 5.0之后的版本可以通过information_schema库来实现:

use information_schema;
select * from columns where column_name='查找字段名' ;



你说的这个information_schema库在哪里,我用的是可视化数据库软件navicat软件,这个软件中如何调出你说的这个库呢

如果有权限的话,navicat直接可以看到这个库的,
我是本地用的,肯定有啊,但没有找到

在phpmyadmin中可查看,你在直接在sql?入就可以。

安装mysql默认会有2个数据库
information_schema
mysql

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn