查询某个表的字段名字及信息

方法1desc <table_name>
例子:查看表名字:GreyList
mysql查询表信息

方法2show create table <table_name>
例子:查看GreyList表
show create table GreyList;

方法3:SELECT * FROM information_schema.columnsWHERE table_schema = <your_database_name> AND table_name = <your_table_name>
例子:查看GreyList表
SELECT * FROM information_schema.columnsWHERE table_schema = ‘nebulalib’ AND table_name = ‘GreyList’;

备注:不要忘记mysql语句后面加 ‘;’ 结束语句

相关文章: