Create General query log

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ozz

    #1

    Create General query log

    Hello,
    I am trying to turn on General logging on mysql server [on a RHE linux
    box].

    If I go >mysqld -l filename
    on shell, it says "command not found". What is the best way to create
    General log on a live server.

    Somehow MYSQL server doesn't have a my.cnf file. I have searched all
    over but there are no signs. Whenever I have to start/stop/restart the
    server, I use the ready-made mysql script.

    Any suggestions??

    Thanks,
    Usman

  • Chander Ganesan

    #2
    Re: Create General query log

    On many installations, the my.cnf file isn't created by default, though
    it is typically in /etc/my.cnf . You can find out where it is expected
    by running: "mysqld --help --verbose"

    You should see a line of output that looks like this (along with a lot
    of other stuff):

    Default options are read from the following files in the given order:
    /etc/my.cnf ~/.my.cnf
    The following groups are read: mysqld server mysqld-5.0


    Once you know what option file to use, create the file and put your
    options in it (in your case, you'd need to add a [mysqld] section to
    the blank file and then enable the general query log under that, then
    restart the server).

    We also provide MySQL and PostgreSQL training - both on-site and public
    enrollment courses. http://www.otg-nc.com

    --
    Chander Ganesan
    Open Technology Group, Inc.
    One Copley Parkway, Suite 210
    Morrisville, NC 27560
    Phone: 877-258-8987/919-463-0999




    Ozz wrote:[color=blue]
    > Hello,
    > I am trying to turn on General logging on mysql server [on a RHE linux
    > box].
    >
    > If I go >mysqld -l filename
    > on shell, it says "command not found". What is the best way to create
    > General log on a live server.
    >
    > Somehow MYSQL server doesn't have a my.cnf file. I have searched all
    > over but there are no signs. Whenever I have to start/stop/restart the
    > server, I use the ready-made mysql script.
    >
    > Any suggestions??
    >
    > Thanks,
    > Usman[/color]

    Comment

    Working...