Is there any way to recover the history of all queries executed on a Mysql server?

Asked

Viewed 1,310 times

0

I have a transaction in a table of a Mysql and (php+apache) database. I wanted to know if I could recover (either in apache log or Mysql log) the ip from which the query that made this insertion was generated. Any idea?

  • It has to configure the log of queries, but it is not possible to recover the IP, because all queries run from the same server. https://stackoverflow.com/questions/303994/log-all-queries-in-mysql

  • Actually if the application server is not in the same host database information is possible to recover this address. But if what you want is client-side information then the thing becomes more difficult. You can try crossing the logs Apache and Mysql but the simplest solution is to register the program in PHP log from Apache or in a proper file the information you need.

1 answer

1


It’s called general query log and is disabled by default. Enabling it the server will store each operation performed; it is worth reading the documentation on the subject as it is possible to create a list of SQL commands that you do not need to save in the log.

  • that’s what I was looking for. but unfortunately mine is not enabled. I will enable for future logs. thanks

Browser other questions tagged

You are not signed in. Login or sign up in order to post.