获取MySQL数据库上次更改的日期/时间 [英] Getting the date/time of the last change to a MySQL database

查看:104
本文介绍了获取MySQL数据库上次更改的日期/时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在和MySQL一起工作,我希望得到数据库中任何表的最后一次更改的日期/时间。我的每个表都有自动更新'* _modified'时间戳,所以我可以使用这个(*是一个前缀)。



这样做的目的是解决如果自从上次数据库备份的日期/时间以来,数据已经发生了变化。



我想知道使用DESCRIBE或SHOW吗?感谢您的帮助。

解决方案

  SELECT update_time 
FROM information_schema.tables
WHERE table_schema ='dbName'
AND table_name ='tableName'


I'm working with MySQL and I would like to get the date/time of the very last change to any table within a database. Each of my tables has an auto updating '*_modified' timestamp so I could use this (* is a prefix).

The purpose of this is to work out if the data has changed at all since the date/time of the last database backup.

I was wondering is there an simpler way to do this using DESCRIBE or SHOW? I've searched and experimented, but found nothing yet.

Thanks for the help.

解决方案

SELECT update_time
FROM   information_schema.tables
WHERE  table_schema = 'dbName'
       AND table_name = 'tableName'

这篇关于获取MySQL数据库上次更改的日期/时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆