Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: TiDB在哪里能看到是谁删除了数据
[TiDB Usage Environment] Production Environment
[TiDB Version]
[Reproduction Path] What operations were performed when the issue occurred
[Encountered Issue: Issue Phenomenon and Impact]
Hope to find out which user deleted the data
[Resource Configuration]
[Attachment: Screenshot/Log/Monitoring]
If tidb_general_log
is enabled in TiDB, it can be found in the logs of the TiDB node.
show variables like “%tidb_general_log%”;
If the general log is not enabled, check if the slow log can be found.
Isn’t there a record of SQL in the dashboard? Go check it out there?
It seems that the dashboard records execution times greater than a certain threshold. If you delete SQL execution time segments, it probably won’t be recorded.
The dashboard can show the full SQL for the past few hours.
The best solution is to use database auditing features to complete the application. ProxySQL is an open-source solution, but when using ProxySQL for database auditing, while the auditing metrics are effective, it tends to excessively split SQL operations and include a large number of SQL execution operations containing sensitive information. This results in redundant operation logs being recorded in the logs.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.