Home  >  Article  >  Database  >  How to get the creation date of a MySQL table?

How to get the creation date of a MySQL table?

WBOY
WBOYforward
2023-09-03 14:37:061454browse

How to get the creation date of a MySQL table?

To get the creation date of a MySQL table, use create_time in information_schema.tables. The syntax is as follows -

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

My table name is "skiplasttenrecords" and the database is "test".

Implement the above syntax for your database and table names. The query is as follows -

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

The following is the output showing the creation date -

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

The above is the detailed content of How to get the creation date of a MySQL table?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete