mysql常用查看表结构的SQL语句时间:2024-04-15 18:55:37 1.查看表结构: SELECT column_name,data_type FROM information_schema.columns WHERE table_name=\'数据库表名\'; 2.查看表的主键: SELECT column_name AS 主键 FROM INFORMATION_SCHEMA.`KEY_COLUMN_USAGE` WHERE table_name=\'数据库表名\' AND constraint_name=\'PRIMARY\'