mysql 查询表相关语句

联系:手机(13429648788)  QQ(107644445)

链接:https://www.orasos.com/mysql-%e6%9f%a5%e8%af%a2%e8%a1%a8%e7%9b%b8%e5%85%b3%e8%af%ad%e5%8f%a5.html

标题:mysql 查询表相关语句

作者:惜分飞©版权所有[文章允许转载,但必须以链接方式注明源地址,否则追究法律责任.]

1、查询表结构
desc tablename;
show full columns from tablename;
select * from information_schema.columns where table_name=’tablename’;

2、查询表相关信息
select * from information_schema.tables where table_name=’tablename’;

3、查询列编码
select table_schema,table_name,column_name,character_set_name,collation_name from information_schema.columns where table_name=’tablename’;

4、查询表编码
select table_name,table_collation from information_schema.tables where table_name=’tablename’;