0

I need to keep track of every select,update,delete and insert of a certain mysql user. I have try this solution . I can see on localhost the general_log table that contains all the queries created by a mysql user. Anyway i have tried this solution on a shared machine and i obtain this message:

SELECT command denied to user for table 'general_log'

So my question is, there is a common (and compatible) behaviour to create a complete queries log in a web application ?

user31929
  • 1,115
  • 20
  • 43
  • Remember on a hosted server you are sharing MySQL Server with maybe 1000 other sites. You do not have the privilages to mess with it because its not all yours – RiggsFolly Feb 17 '20 at 16:56
  • And because you are 1 of a 1000 they probably dont want this overhead applied to all 1000 databases just because you want it – RiggsFolly Feb 17 '20 at 16:57
  • It would also mean that you could see all the executed SQL from the other 999 sites and they could see yours – RiggsFolly Feb 17 '20 at 16:59
  • yes it is understandable, i think anyway that this is a common need, so maybe there is a "another and correct way" to achive the result – user31929 Feb 17 '20 at 17:00
  • 1
    You have to build that into your code – RiggsFolly Feb 17 '20 at 17:02
  • 1
    Some PERFORMANCE_SCHEMA tables also record SQL statements per thread or globally. But your shared hosting site probably has not enabled these. You'll likely have to create your own log at the client level. That is, your application code will be responsible for logging every query it executes. – Bill Karwin Feb 17 '20 at 20:12

0 Answers0