Logging Queries on MYSQL

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

    Logging Queries on MYSQL

    Hi all

    I am running Red Hat and MySQL, I am needing to make it that mysql logs all
    queries done on the server, at the moment my /etc/my.cnf file looks like
    this.

    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    [mysql]
    user=mysql
    basedir=/var/lib

    [safe_mysqld]
    err-log=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid

    What do I need to do to accompish this , I have looked on google and just
    cant find the answer at all to this.

    Thanks in advance

    --
    Kind Regards





  • Jonathan

    #2
    Re: Logging Queries on MYSQL

    On Fri, 14 Jan 2005 16:33:26 GMT, "CK" <puevf@pxfernyz .pbz> wrote:
    [color=blue]
    >Hi all
    >
    >I am running Red Hat and MySQL, I am needing to make it that mysql logs all
    >queries done on the server, at the moment my /etc/my.cnf file looks like
    >this.
    >
    >[mysqld]
    >datadir=/var/lib/mysql
    >socket=/var/lib/mysql/mysql.sock
    >[mysql]
    >user=mysql
    >basedir=/var/lib
    >
    >[safe_mysqld]
    >err-log=/var/log/mysqld.log
    >pid-file=/var/run/mysqld/mysqld.pid
    >
    >What do I need to do to accompish this , I have looked on google and just
    >cant find the answer at all to this.
    >
    >Thanks in advance[/color]

    Whiy not us e binary logging.

    For starters just enter the following line in you configuration file:

    log-bin

    and have a look here:


    If you have further questions just get back and ask!

    Good luck!

    Jonathan

    Comment

    • CK

      #3
      Re: Logging Queries on MYSQL


      "Jonathan" <jonathan@heela l.nl> wrote in message
      news:2fvfu01liu 811s1prumoco4mt qcele44ac@4ax.c om...[color=blue]
      > On Fri, 14 Jan 2005 16:33:26 GMT, "CK" <puevf@pxfernyz .pbz> wrote:
      >[color=green]
      >>Hi all
      >>
      >>I am running Red Hat and MySQL, I am needing to make it that mysql logs
      >>all
      >>queries done on the server, at the moment my /etc/my.cnf file looks like
      >>this.
      >>
      >>[mysqld]
      >>datadir=/var/lib/mysql
      >>socket=/var/lib/mysql/mysql.sock
      >>[mysql]
      >>user=mysql
      >>basedir=/var/lib
      >>
      >>[safe_mysqld]
      >>err-log=/var/log/mysqld.log
      >>pid-file=/var/run/mysqld/mysqld.pid
      >>
      >>What do I need to do to accompish this , I have looked on google and just
      >>cant find the answer at all to this.
      >>
      >>Thanks in advance[/color]
      >
      > Whiy not us e binary logging.
      >
      > For starters just enter the following line in you configuration file:
      >
      > log-bin
      >
      > and have a look here:
      > http://dev.mysql.com/doc/mysql/en/Binary_log.html
      >
      > If you have further questions just get back and ask!
      >
      > Good luck!
      >
      > Jonathan[/color]


      Tried that still cant seem to get it logging at all,



      --
      Kind Regards




      Comment

      • Jonathan

        #4
        Re: Logging Queries on MYSQL

        On Fri, 14 Jan 2005 17:19:49 GMT, "CK" <puevf@pxfernyz .pbz> wrote:
        [color=blue]
        >
        >"Jonathan" <jonathan@heela l.nl> wrote in message
        >news:2fvfu01li u811s1prumoco4m tqcele44ac@4ax. com...[color=green]
        >> On Fri, 14 Jan 2005 16:33:26 GMT, "CK" <puevf@pxfernyz .pbz> wrote:
        >>[/color][/color]

        cut
        [color=blue][color=green]
        >> Whiy not us e binary logging.
        >>
        >> For starters just enter the following line in you configuration file:
        >>
        >> log-bin
        >>
        >> and have a look here:
        >> http://dev.mysql.com/doc/mysql/en/Binary_log.html
        >>
        >> If you have further questions just get back and ask!
        >>
        >> Good luck!
        >>
        >> Jonathan[/color]
        >
        >
        >Tried that still cant seem to get it logging at all,[/color]

        How do you mean can't seem to get it logging at all?

        If it is working there should be some extra files in your data dir.
        They should be called something like <server name>-xxx.bin or
        something like that.

        You could be able to view them with mysqlbinlog a tool that is in your
        mysql/bin directory. The manual will tell you how to do so...
        hopefully you will get some results as I got to go now. Will check
        back later!

        Jonathan

        Comment

        • Shane Niebergall

          #5
          Re: Logging Queries on MYSQL

          Are you restarting mysql when you make the change? Changes to config files
          won't take effect until the server is restarted.

          Thanks,
          Shane

          "CK" <puevf@pxfernyz .pbz> wrote in message
          news:VaTFd.1333 72$48.127628@fe 1.news.blueyond er.co.uk...[color=blue]
          >
          > "Jonathan" <jonathan@heela l.nl> wrote in message
          > news:2fvfu01liu 811s1prumoco4mt qcele44ac@4ax.c om...[color=green]
          > > On Fri, 14 Jan 2005 16:33:26 GMT, "CK" <puevf@pxfernyz .pbz> wrote:
          > >[color=darkred]
          > >>Hi all
          > >>
          > >>I am running Red Hat and MySQL, I am needing to make it that mysql logs
          > >>all
          > >>queries done on the server, at the moment my /etc/my.cnf file looks like
          > >>this.
          > >>
          > >>[mysqld]
          > >>datadir=/var/lib/mysql
          > >>socket=/var/lib/mysql/mysql.sock
          > >>[mysql]
          > >>user=mysql
          > >>basedir=/var/lib
          > >>
          > >>[safe_mysqld]
          > >>err-log=/var/log/mysqld.log
          > >>pid-file=/var/run/mysqld/mysqld.pid
          > >>
          > >>What do I need to do to accompish this , I have looked on google and[/color][/color][/color]
          just[color=blue][color=green][color=darkred]
          > >>cant find the answer at all to this.
          > >>
          > >>Thanks in advance[/color]
          > >
          > > Whiy not us e binary logging.
          > >
          > > For starters just enter the following line in you configuration file:
          > >
          > > log-bin
          > >
          > > and have a look here:
          > > http://dev.mysql.com/doc/mysql/en/Binary_log.html
          > >
          > > If you have further questions just get back and ask!
          > >
          > > Good luck!
          > >
          > > Jonathan[/color]
          >
          >
          > Tried that still cant seem to get it logging at all,
          >
          >
          >
          > --
          > Kind Regards
          >
          > www.ckconsultants.co.uk
          >
          >[/color]


          Comment

          Working...