首页 > 数据库技术 > 详细

mysql查询表名和列名字

时间:2019-10-09 12:04:27      阅读:79      评论:0      收藏:0      [点我收藏+]

-- 登录yellowcong 数据库

mysql -uroot -proot yellowcong

? ?

-- 查看当前数据库

select database()

? ?

-- 查看数据库里面的表

--table_schema 当前的数据库

--table_type=‘base table‘ 表示基础的普通表

SELECT table_name FROM information_schema.tables WHERE table_schema=‘yellowcong‘ AND table_type=‘base table‘;

? ?

? ?

-- 查询指定数据库中指定表的所有字段名column_name

-- 查看列的名称

SELECT column_name FROM information_schema.columns WHERE table_schema=‘yellowcong‘ AND table_name=‘sys_user‘;

mysql查询表名和列名字

原文:https://www.cnblogs.com/withfeel/p/11640817.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!