Our webserver is running FreeBSD, for the last few days we have been having an issue with our cronjobs/mysql server.
Specifically we have jobs that execute php scripts to do various things to the website. When running these php scripts manually, via external browser, or lynx on the server, they run as expected, no issues. When running via cron, they experience connectivity issues to the mysql server. Users get denied to tables, or the connection doesn't get created. As you can imagine this has caused all kinds of havoc.
The question is, has anyone experienced this type of error before?
You can help yourself searching in the forum's base on how to troubleshoot cron jobs that aren't working, but here are my two cents : redirect the output of the command in a file and see what happens. Also, I've fixed such issues in FreeBSD 5.4 by restarting the cron service.
Tried to restart Cron, that didn't seem to solve the problem. I did try a search through the forum before posting, but didn't find anything specific to my issue. This is the error message I receive when trying to connect to mysql,
Could Not connect to Database on host:
localhost
Can't connect to local MySQL server through socket '/tmp/mysql.sock'
The server is running, and I am able to connect to it via mysql command line, the website, and phpmyadmin. It only fails when cron tries to access it
Looks like the error was due to a corrupt privileges table. After resorting the table everything seems to work now. It's just odd that it wouldn't work on cron.