MySQL은 모든 테이블과 테이블 구조를 가져옵니다.

1. 모든 테이블 속성을 가져 오십시오. 명령문은 다음과 같습니다.

select table_name tableName, 
   engine, 
   table_comment tableComment, 
   table_collation tableCollation, 
   create_time createTime 
from information_schema.tables
where table_schema = (select database())
order by create_time desc

2. 테이블 구조를 가져 오십시오. 명령문은 다음과 같습니다.

select column_name columnName, 
   data_type dataType, 
   column_comment columnComment, 
   column_key columnKey, 
   extra ,
   is_nullable as isNullable,
   column_type as columnType 
from information_schema.columns
where table_name = 't_sys_personnel' 
   and table_schema = (select database()) 
order by ordinal_position;

 

추천

출처blog.csdn.net/joyksk/article/details/113889668