The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Turning in MySQL session logging

Discussion in 'General Discussion' started by n000b, Aug 20, 2006.

  1. n000b

    n000b Well-Known Member

    Joined:
    Apr 7, 2005
    Messages:
    142
    Likes Received:
    0
    Trophy Points:
    16
    Hi,

    In the last week, at least 3 times MySQL has taken all the CPU time and took my server load up to above 20. I want to turn on MySQL session logging so that I can try to troubleshoot and track the issue.

    Does anyone know how I can turn on session logging for all users? I know I can use the \T logfile.txt command when in MySQL, but I think that only turns it on for the one user, and I don't really want to go through and do it for every user :p

    Thanks :)
     
  2. esolutions

    esolutions Member

    Joined:
    Aug 16, 2006
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Need help too

    Did you ever get this answered? I need to turn on mysql query/session logging as well and I have no idea how to do it. I've tried adding log=/var/log/mysql_queries.log in /etc/my.cnf, but it doesn't work :(

    Any help would be greatly appreciated. Thanks.
     
  3. n000b

    n000b Well-Known Member

    Joined:
    Apr 7, 2005
    Messages:
    142
    Likes Received:
    0
    Trophy Points:
    16
    Yeah I did.

    Are you adding it under the [safe_mysqld] heading in my.cnf? I think that's where I added mine.

    Also, do you have MySQL error logging turned on? If so, check that file as it will probably tell you what's going wrong. I *think* you might have to actually create the log file before restarting MySQL so just run "touch /var/log/mysql_queries.log" before restarting MySQL and adding the entry to my.cnf :)


    Just a word of warning - the file grows *very* quickly!
     
  4. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
Loading...

Share This Page