?
Solved

Query for last database updated date in MySQL

Posted on 2015-01-13
4
Medium Priority
?
62 Views
Last Modified: 2016-06-18
Hi All,

Could some body provide me query to find last updated of the database in mYSQL.

Regards,
Sreeni
0
Comment
Question by:GK GK
  • 2
3 Comments
 
LVL 8

Expert Comment

by:Jayaraja Jayaraman
ID: 40546885
SELECT max(last_user_update) last_user_update
FROM sys.dm_db_index_usage_stats
WHERE database_id = DB_ID( 'YOUR_DBNAME_HERE')

or

This Blog entry contains information on how to do it on SQL Server 2008 and 2005.
http://sqlblog.com/blogs/aaron_bertrand/archive/2008/05/06/when-was-my-database-table-last-accessed.aspx
0
 

Author Comment

by:GK GK
ID: 40548355
Thanks Jayaraj,

Will it work for MySQL ?


Regards.
Sreeni
0
 

Accepted Solution

by:
GK GK earned 0 total points
ID: 40549108
Hi All,

I found the query

Select table_Schema,max(UPDATE_TIME) FROM information_schema.TABLES group by table_Schema;

UPDATE_TIME works for MyISAM. If required other Engines  we will look into each table in each schema to see if there is any date columns that are populated with latest.

Lot of thanks for support.

Regards,
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month14 days, 11 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question