Log every MySQL query to a file by enabling the General Log in MAMP

后端 未结 1 1313
甜味超标
甜味超标 2021-02-04 15:51

How can I enable the General Log for MySQL for use with MAMP?

I use it to run Apache, MySQL and PHP on my Mac so I can turn on/off/restart via a UI instead of messing wi

1条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-04 16:33

    I tried running the command SET GLOBAL general_log = 'ON'; to see if I could get it to work that way. This produced an error message File Not Found, even though the file did exist.

    This indicated to me that problem may be due to file permissions.

    After some playing around, I changed:

    1. the owner of the file to match the user that the MySQL service was being run under, and
    2. gave that user "write access" to the file

    Since making those changes, it's been working perfectly ever since.

    0 讨论(0)
提交回复
热议问题