SELECT
TABLE_NAME, INDEX_NAME, GROUP_CONCAT(COLUMN_NAME) as INDEX_COLUMN
FROM
information_schema.statistics
where
table_schema='库名'
GROUP BY TABLE_NAME, INDEX_NAME;
查询MySQL数据库中所有表的索引
最新推荐文章于 2025-04-13 22:49:10 发布
SELECT
TABLE_NAME, INDEX_NAME, GROUP_CONCAT(COLUMN_NAME) as INDEX_COLUMN
FROM
information_schema.statistics
where
table_schema='库名'
GROUP BY TABLE_NAME, INDEX_NAME;