Mysql 如何获取数据库中所有表的非索引列列表?

Mysql 如何获取数据库中所有表的非索引列列表?,mysql,Mysql,我想得到数据库中整个表的非索引列的详细列表 请帮助我如何在MySQL中获取列表 谢谢。单桌使用: show columns from tablename where `Key` is not null and `Key` != ''; 对于整个架构/数据库,请使用以下命令: select distinct table_name, index_name from information_schema.statistics where table_schema = 'your_databa

我想得到数据库中整个表的非索引列的详细列表

请帮助我如何在MySQL中获取列表


谢谢。

单桌使用:

show columns from tablename where `Key` is not null and `Key` != '';
对于整个架构/数据库,请使用以下命令:

select distinct
  table_name,
  index_name
from information_schema.statistics
where table_schema = 'your_database_name';
对于所有数据库,请删除where子句

已在的文件中描述

键字段指示是否为列编制索引:

如果键为空,则该列不编制索引或仅编制索引 作为多列中的第二列,非唯一索引


我需要一个查询来搜索数据库中的所有表。