简体   繁体   中英

Where can I find the MySQL transaction log?

Does MySQL keep a transaction log and if so where could I find it?

A number of rows have mysteriously been deleted from a table and I want to try and see how and when it occurred.

If you turned on - mysql can track binary log , which contains all the modifications (to be clear - it contains the queries that had changed something).

But anyway, it is useless if you do not have the initial dump, which precedes the binlog turning on. Also i suppose if you made the dump and turned on binlog - you would not ask such question :-S

如果你在Windows上使用MySql,那么有一个文件位于C:\\Program Files\\MySQL\\MySQL Server 5.0\\data (假设安装目标的C:驱动器和MySql版本5.0),称为%COMPUTERNAME%。包含已执行命令的日志。

Short answer: not by default.

In order to have accurate logging results, you need to have started the server in binary logging mode first, using the parameter --log-bin=your-file-name . It then creates a binary log file <> where seq is a sequence number for subsequent log files (recommended to put your file name there, with explicit directory location).

More information on the MySQL site explaining all the details: https://dev.mysql.com/doc/refman/5.7/en/binary-log.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM