0

is there a way to list all queries that are executed by PHP script? How I see it - when PHP script send a query to DB, for example: SELECT * FROM table, I would like to save the query string, name of the file that send that query and time. Is it possible when I don't have access to PHP script? What if I do have? Maybe there are that kind of logs in php my admin? Thanks in advice.

4

1 回答 1

1

有两种方法可以做到这一点:

  1. 使用日志,启用 Mysql 日志,因此每个查询都记录在日志中,但限制是您必须再次查询日志才能查看特定内容。

  2. 其次,方法是创建触发器,以便将每个活动都记录在表中。例如:

    创建 ON INSERT、ON_UPDATE 和 ON_DELETE 触发器

对于将所有更改的详细信息写入审计活动表的表

于 2013-08-13T06:38:16.813 回答