Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL: How can I get the timestamp of the last insertion to the database

How can I check when was the last time (timestamp) that I wrote in the database, irrespectively of the database table that I inserted into?

like image 978
user690182 Avatar asked Mar 11 '12 17:03

user690182


People also ask

How can I see last inserted record in MySQL?

If you are AUTO_INCREMENT with column, then you can use last_insert_id() method. This method gets the ID of the last inserted record in MySQL.

How can I tell when a MySQL table was last updated?

Syntax to know the last updated time. SELECT UPDATE_TIME FROM information_schema. tables WHERE TABLE_SCHEMA = 'yourDatabaseName' AND TABLE_NAME = 'yourTableName'; Let us implement the following query to get the last updated time.

How is TIMESTAMP stored in MySQL?

MySQL converts TIMESTAMP values from the current time zone to UTC for storage, and back from UTC to the current time zone for retrieval. (This does not occur for other types such as DATETIME .) By default, the current time zone for each connection is the server's time.


1 Answers

Just use this SQL: SHOW TABLE STATUS; and check Update_time column.

like image 177
ViES Avatar answered Sep 25 '22 00:09

ViES