Forum Moderators: open

Message Too Old, No Replies

MySQL logging blues

Error log, slow log and general log question

         

mattcg

1:55 pm on Dec 15, 2006 (gmt 0)

10+ Year Member



I am running MySQL 5.0.24 in a Windows NT environment. (The reason is because I am migrating to open source one step at a time - first db server, then web and finally os.)

Understanding the basics of the way MySQL logging works is 50 per cent of my MySQL configuration nightmare. I have been through the relevant documentation, and even that bloated mess called MySQL Administrator (20MB of RAM and it doesn't even check which startup variables are enabled or disabled, and won't complain about applying the same variable twenty times in the same conf file - I know it's a free tool, but this is 2006 not 1986).

The first thing that I have tried to do unsuccessfully is to disable the general/binary/update log (I'm not sure which one it is, there are two files of exactly 10MB each called ib_logfile0 and ib_logfile1, containing padding data and modifying queries). As far as I could conclude, the main purpose of this log is to provide a source of backup data in an emergency. Is this correct? If so, because I have my own backup solution, I have no use for this log. (Another point is that MySQL administrator doesn't even know that this log exists - the 'General log' tab is grayed out - or is this an entirely different log? Arrgh!).

The second thing that I have tried to do unsucessfully is to enable the error log and slow query log. I am trying to specify my own file name for the error log in mysql.ini, but it is ignored completely and I just end up with servername.err. The slow query file name is also ignored, but then again it probably is because I have no slow queries (is there any way to test the slow query log?).

justageek

4:15 pm on Dec 15, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You may want to go and check out the MySQL site and read through the documentation to get info on each storage engine to see which one will suit your needs. The files ib_logfile0 and ib_logfile1 are for the transaction based InnoDB engine and not used just as a backup solution so to remove them would do a little more than just free up some space. The easy way to remove them would be to use another storage engine such as MySQL and not run InnoDB.

As for the slow query log logging you can change long_query_time to a smaller number and/or just do a hard query such as a 'like' search on a larger table with no indexes in a varchar field so you can exceed the time in your long_query_time variable.

JAG