Restarting MySQL from CRON

Gerard Seibert gerard-seibert at suscom.net
Sat Sep 10 11:05:36 PDT 2005


On Saturday, September 10, 2005 12:27:02 PM Dan Nelson <dnelson at allantgroup.com> wrote:

> In the last episode (Sep 10), Gerard Seibert said:
> > From time to time, I have found that MySQL has ceased to run. I have
> > a mailing program that requires that MySQL be running in order for it
> > to operate.
> > 
> > Since I cannot seem to track down why it occasionally stops
> > functioning, and since the program that depends on it is started via
> > CRON, would it be advisable to put an entry into the CRON that would
> > restart MYSQL prior to the other program running.
> > 
> > I was thinking of using this:
> > 
> > 0  0  *  *  * /usr/local/etc/rc.d/mysql-server.sh restart
> > 
> > Would that work, or is there a better way?
> 
> "start" is better than "restart", since that won't cause an existing
> mysqld to exit.  But the startup script runs a script called
> mysqld_safe, which automatically restarts mysqld if it crashes anyway. 
> You might want to check your mysql .err log; maybe someone with the
> SHUTDOWN privilege is doing a clean shutdown.
> 
> -- 
> 	Dan Nelson
> 	dnelson at allantgroup.com


********** Reply Separator **********
Saturday, September 10, 2005 2:00:47 PM

It definitely does not restart automatically. In addition, I am the only
user with root access. I doubt that anyone is shutting it down, even by
mistake.

Where do I find this mysql error file? I cannot seem to locate it.

Thanks for your assistance.



More information about the freebsd-questions mailing list