Why do cronjobs for the MySQL user send email to root?
Environment
- Red Hat Enterprise Linux 5.7
- MySQL database
Issue
- cronjobs for the user "mysql" deliver emails to "root"
- setting "MAILTO=mysql@localhost.localdomain" in the crontab for the "mysql" user are not effective, mail is delivered to "root" never the less
Resolution
- edit /etc/aliases and comment out "mysql: root" with a #:
#mysql: root - activate the updated aliases:
# /usr/bin/newaliases
Root Cause
By default, "mysql" is an alias for "root". Any email directed to "mysql@localhost.localdomain" will be forwarded to "root".
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
