Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Get timestamp of last modify of MySQL table

by LanX (Saint)
on Mar 05, 2022 at 19:03 UTC ( [id://11141860]=note: print w/replies, xml ) Need Help??


in reply to Get timestamp of last modify of MySQL table

maybe have a look at https://mariadb.com/kb/en/myisam-log/ ?

edit

I remember seeing meta-tables with extensive schema information. You should have a look there.

Like UPDATE_TIME in https://dev.mysql.com/doc/refman/8.0/en/information-schema-tables-table.html

No guaranty, sorry.

This is not really a Perl question ...

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^2: Get timestamp of last modify of MySQL table
by Anonymous Monk on Mar 05, 2022 at 21:59 UTC

    Thank you. This brought me to the solution:

    my $sql = "SELECT UPDATE_TIME FROM information_schema.tables WHERE TAB +LE_NAME = 'name_of_table'";
      Beware,

      > Timestamps are not persisted when the server is restarted or when the table is evicted from the InnoDB data dictionary cache.

      And given that file time stamps (on the system) are unreliable and fragile, I suggest if there is a "time" you want to track reliably/correctly and precision is not a priority, using time stamp fields in your tables is going to give you the best and most reliable result.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11141860]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-03-28 23:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found