How do you get the last access (and/or write) time of a MySQL database?

后端 未结 3 2488
无人共我
无人共我 2021-02-20 18:57

How do you find out the last time a MySQL database was read or written to?

Can you even do that check per table?

3条回答
  •  南方客
    南方客 (楼主)
    2021-02-20 19:24

    If your database has bin logs switched on, you can get the last update time using mysqlbinlog.

    If your database has query logging enabled, you can get the last query time (either updates or selects) by tailing the query log.

提交回复
热议问题