开发者

Execute a function each time mysql_query is called. (PHP)

开发者 https://www.devze.com 2023-03-16 18:21 出处:网络
I\'ve inherited so开发者_Python百科me code which uses raw \"mysql_query\". No wrapper or anything.

I've inherited so开发者_Python百科me code which uses raw "mysql_query". No wrapper or anything. I want to get a log of every query sent to MySQL and the server guy has gone home, so I can't ask him to turn query logging on for a moment.

Is there any way of doing this?

Cheers.


run:

mysql_query('SET GLOBAL general_log = 1;');


You might be able to do it with SET GLOBAL general_log = 'ON';


  • install mysql_proxy somewhere,
  • configure it with a LUA script to log all statements.
  • connect the proxy to the real server
  • connect your application to the proxy (database connection settings)
0

精彩评论

暂无评论...
验证码 换一张
取 消