在Mysql的shell命令行下查询表的结构:
1.desc(描述)命令
desc tablename;
describe tablename;
2.show命令
show columns from tablename;
show create table tablename
3.select命令(SQL语句)
#查看表中所有列的信息
use information_schema;
select column_name from columns where table_name=‘table_name‘;
#查看所有列的信息
select column_name from columns where table_name=‘table_name‘;
--未完待续
时间: 2024-10-13 17:29:39