Sunday, September 7, 2014

Find the Database Creation date in Mysql

5:32 PM

 To find the database creation date in MYSQL simply follow the below steps :


First enter into the mysql database.

root@linuxstorages:~#mysql -u root -p
Enter Password:

 DATABASE with all it TABLES

By executing the below command its shows the database and all tables creation date.

SYNTAX

mysql> SELECT create_time FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'DATABASE NAME';

EXAMPLE

mysql> SELECT create_time FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'test';
+---------------------+
| create_time         |
+---------------------+
| 2014-08-22 13:06:47 |
+---------------------+
1 row in set (0.14 sec)

DATABASE with particular TABLE

By executing the below command we can able to see a single table creation date in a database.

SYNTAX

mysql> SELECT create_time FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'DB_NAME' AND table_name = 'TABLE_NAME'

EXAMPLE

mysql> SELECT create_time FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'test123' AND table_name = 'widget';
+---------------------+
| create_time         |
+---------------------+
| 2013-11-19 18:52:32 |
+---------------------+
1 row in set (0.23 sec)
 

Written by

2 comments :

  1. Thanks for sharing this useful content. How to create stored procedure in mysql with example and 5 Career Pathways with an ITIL service transition certification Stored Procedure

    ReplyDelete
  2. Thanks for sharing this useful Content. In Auth0 applications, the user database is included by default, but what happens when you want to connect social media?

    GitHub Social Connection

    ReplyDelete

 

© 2014 Linux Storages | Updated . All rights resevered. Designed by Templateism