开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜