MySql】查询数据库中所有表及列的信息

SELECT table_name ,table_rows
FROM information_schema.tables 
WHERE table_schema='数据库名称'
ORDER BY table_rows DESC; 
 
----------------------------------------------------
SELECT 
  TABLE_NAME,          -- 表名
  COLUMN_NAME,         -- 字段名
  DATA_TYPE,           -- 字段类型
  COLUMN_COMMENT        -- 字段注释
FROM
 INFORMATION_SCHEMA.COLUMNS 
WHERE TABLE_SCHEMA = '数据库名称'
 
use information_schema;

select table_name,table_rows from tables 
where TABLE_SCHEMA = 'testdb' 
order by table_rows desc; 
posted @ 2022-09-16 10:21  Rukh  阅读(925)  评论(0编辑  收藏  举报