b4rt3kk
b4rt3kk

Reputation: 1569

List all queries to database

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.

Upvotes: 0

Views: 330

Answers (1)

Vineet1982
Vineet1982

Reputation: 7918

There are two ways to do that:

  1. Use the Logs, Enable the Mysql Logs thus every query is recorded in the log but the limitation is you have to again query the logs to view specific things.

  2. Second, way is to create trigger so that every activity is recorded in table. for example:

    Create ON INSERT, ON_UPDATE and ON_DELETE triggers

for your table that write details of all changes to an audit activity table

Upvotes: 1

Related Questions