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:
- MySQL Log File
- MySQL Start Script
- MySQL Backup and my.cnf
- MySQL Backup and Restore
- Create MySQL User
- How to Stop a Cron Job or Email Notification
- Using Perl and MySQL
- Monitor Your Server
Filed Under: MySQL
March 3rd, 2009 at 1:27 am
No point in only checking them once a day if they’ve been corrupted all day.
March 3rd, 2009 at 1:40 am
I didn’t check it at all, once per day is a big progress.