如何獲取 MySQL 表的建立日期?


要獲取 MySQL 表的建立日期,請使用 information_schema.tables 中的 create_time。語法如下 −

SELECT create_time FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'yourDatabaseName' AND table_name = 'yourTableName';

我的表名為“skiplasttenrecords”,資料庫為“test”。

為你的資料庫和表名實現以上語法。查詢如下 −

mysql> SELECT create_time FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'test'
   −> AND table_name = 'skiplasttenrecords';

以下是顯示建立日期的輸出 −

+---------------------+
| CREATE_TIME         |
+---------------------+
| 2018-11-29 15:47:14 |
+---------------------+
1 row in set (0.00 sec)

更新於: 2019 年 7 月 30 日

8K+ 次瀏覽

啟動你的 職業

完成課程獲得認證

開始
廣告
© . All rights reserved.