Home > MySQL > Monitor MySQL Log File

Monitor MySQL Log File

March 2, 2009 Posted by KP

I rarely check MySQL log file, but recently I got some table corruption errors, and it’s hard to notice these errors, especially when these tables are not critical. I realized that it’s necessary to monitor MySQL log file. According to MySQL manual, before version 5.1.20, it’s not possible to log MySQL errors to syslog. I’m still using 5.0, so I added the following line to cron job of my root account:

30 2 * * * tail -n 50 /var/db/mysql/hostname.err

Now I get notification email daily (no email if it’s empty), not a bad solution.



Related Posts:

Filed Under: MySQL

2 Comments to “Monitor MySQL Log File”

  1. Chris Says:

    No point in only checking them once a day if they’ve been corrupted all day.

  2. FreeBSD Newbie Says:

    I didn’t check it at all, once per day is a big progress. :-)

Leave a Comment

(required)
(will not be published, required)

* Copy this password:

* Type or paste password here:






Archives

Links