select TABLE_NAME, INDEX_NAME, GROUP_CONCAT(COLUMN_NAME) as INDEX_COLUMN
from
information_schema.statistics
where
table_schema='数据库schema名'
-- and INDEX_NAME='索引名'
GROUP BY TABLE_NAME, INDEX_NAME;
mysql索引名是可以同名的,但不建议同名。
select TABLE_NAME, INDEX_NAME, GROUP_CONCAT(COLUMN_NAME) as INDEX_COLUMN
from
information_schema.statistics
where
table_schema='数据库schema名'
-- and INDEX_NAME='索引名'
GROUP BY TABLE_NAME, INDEX_NAME;
mysql索引名是可以同名的,但不建议同名。