How to find Database Schema Created Date in MySQL - DevDummy

Latest

Views | Thoughts | Concepts | Techniques

Monday, September 03, 2018

How to find Database Schema Created Date in MySQL



While working with developer testing and related stuff, it is often required to update the database schema, use old versions or revert back & forth. However after working with few versions it is often miss the track of the schema creations/ updates.

MySQL information_schema tables come in to help on this. It keeps a record on each and every schema creations and updates.

To fetch the above statistics for the required schema, following query can be executed,

SELECT * FROM information_schema.TABLES WHERE TABLE_SCHEMA = "location_app";


SCHEMA() function on MySQL returns the currently selected schema, so it is possible to use that straightaway.

SELECT * FROM information_schema.TABLES WHERE TABLE_SCHEMA = SCHEMA();

More importantly, it is possible to set a specific table name as well.

References 



No comments:

Post a Comment