"MySQL 테이블 생성일시 확인"의 두 판 사이의 차이

 
26번째 줄: 26번째 줄:
| TABLE_SCHEMA | TABLE_NAME                                    | CREATE_TIME        |
| TABLE_SCHEMA | TABLE_NAME                                    | CREATE_TIME        |
+--------------+-----------------------------------------------+---------------------+
+--------------+-----------------------------------------------+---------------------+
| test                     | table                                                   | 2023-10-03 15:00:01 |
| test             | table                                     | 2023-10-03 15:00:01 |
+--------------+-----------------------------------------------+---------------------+
+--------------+-----------------------------------------------+---------------------+



2023년 10월 3일 (화) 18:15 기준 최신판

How to get the creation date of a MySQL table
MySQL 테이블 생성일시 확인
MySQL 테이블 생성시각 확인

1 방법 1: INFORMATION_SCHEMA[ | ]

SELECT CREATE_TIME FROM INFORMATION_SCHEMA.TABLES WHERE table_name='테이블명';
mysql> SELECT CREATE_TIME FROM INFORMATION_SCHEMA.TABLES WHERE table_name='wp_users';
+---------------------+
| CREATE_TIME         |
+---------------------+
| 2014-12-13 03:51:28 |
+---------------------+
1 row in set (0.00 sec)
SELECT TABLE_SCHEMA, TABLE_NAME, CREATE_TIME FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'DB명' ORDER BY create_time ASC;
MariaDB [(none)]> SELECT TABLE_SCHEMA, TABLE_NAME, CREATE_TIME FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'DB명' ORDER BY create_time ASC;
+--------------+-----------------------------------------------+---------------------+
| TABLE_SCHEMA | TABLE_NAME                                    | CREATE_TIME         |
+--------------+-----------------------------------------------+---------------------+
| test             | table                                     | 2023-10-03 15:00:01 |
+--------------+-----------------------------------------------+---------------------+

1 row in set (0.00 sec)

2 방법 2: SHOW TABLE STATUS[ | ]

SHOW TABLE STATUS WHERE name='테이블명';
mysql> SHOW TABLE STATUS WHERE name='wp_users' \G
*************************** 1. row ***************************
           Name: wp_users
         Engine: MyISAM
        Version: 10
     Row_format: Dynamic
           Rows: 1
 Avg_row_length: 96
    Data_length: 96
Max_data_length: 281474976710655
   Index_length: 4096
      Data_free: 0
 Auto_increment: 2
    Create_time: 2014-12-13 03:51:28
    Update_time: 2014-12-13 03:51:28
     Check_time: 2015-07-02 15:52:18
      Collation: utf8_general_ci
       Checksum: NULL
 Create_options: 
        Comment: 
1 row in set (0.00 sec)

3 같이 보기[ | ]

4 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}