Mysql when was database last updated
To be honest I am not sure about. That is stored in the Schema, and not the table itself. It's a volatile value and can come back NULL after a server restart. Avoid using it for situations where the integrity of your data depends on it being correct.
Show 4 more comments. Oliver Williams Oliver Williams 4, 5 5 gold badges 29 29 silver badges 62 62 bronze badges. Dhanu K Dhanu K 7, 4 4 gold badges 19 19 silver badges 34 34 bronze badges. Sign up or log in Sign up using Google.
Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. For multiple-table updates, there is no guarantee that assignments are carried out in any particular order. If you set a column to the value it currently has, MySQL notices this and does not update it. For information about generated columns, see Section This can be useful in certain situations that might otherwise result in an error.
Suppose that a table t contains a column id that has a unique index. The following statement could fail with a duplicate-key error, depending on the order in which rows are updated:.
For example, if the table contains 1 and 2 in the id column and 1 is updated to 2 before 2 is updated to 3, an error occurs. Its syntax is described in Section Here is an example:. In this case, the statement fails and rolls back. You cannot update a table and select directly from the same table in a subquery. You can work around this by using a multi-table update in which one of the tables is derived from the table that you actually wish to update, and referring to the derived table using an alias.
Suppose you wish to update a table named items which is defined using the statement shown here:. As shown here, this statement does not work:. Instead, you can employ a multi-table update in which the subquery is moved into the list of tables to be updated, using an alias to reference it in the outermost WHERE clause, like this:.
Because the optimizer tries by default to merge the derived table discounted into the outermost query block, this works only if you force materialization of the derived table. This seems to vary depending on table type and platform. Show 1 more comment.
It is mk-table-checksum You could probably lock the tables, run mk-table-checksum and store the checksums, then unlock the tables and then look at the values to see if you need to run mysqldump or not.
Ben Pilbrow 12k 5 5 gold badges 34 34 silver badges 57 57 bronze badges. Would work although it probably would place the same kind of stress onto the database as an entire mysqldump would do. By the way, it has been replaced in ubuntu at least by pt-table-checksum from percona toolkit — Marinos An. Evan Genest Evan Genest 21 2 2 bronze badges. MYD files? John Gardeniers John Gardeniers 27k 12 12 gold badges 52 52 silver badges bronze badges. So I guess I need to know "How do others do it"?
Is binary logs the answer? Based on your concerns about performance I'd suggest simply setting up a slave and running your backups from that. Sign up or log in Sign up using Google. Sign up using Facebook. Collectives on Stack Overflow.
Learn more. Ask Question. Asked 12 years, 11 months ago. Active 2 days ago. Viewed k times. Improve this question. Eric Leschinski k 86 86 gold badges silver badges bronze badges. Related: stackoverflow. Add a comment. Active Oldest Votes. On page display: use stat to read back the file modification time.
Improve this answer. Reed Alnitak Alnitak k 69 69 gold badges silver badges bronze badges. For details including InnoDB limitations see dev. Although this is listed as a bug , it is mentioned in the MySQL 5. For MySQL 5. This does not seem to persist on restart for me on version 5. Show 6 more comments. Meloman 2, 3 3 gold badges 37 37 silver badges 41 41 bronze badges. Bill Karwin Bill Karwin k 81 81 gold badges silver badges bronze badges.
The question really wants to know when relevant data is updated, and not when a table which is irrelevant to the user may or may not have been changed for whatever reason. Ammamon, true, if you also need to account for deletions, this solution doesn't reflect that.
0コメント