I'd like to know is there a way that I can run a cron-job to reset the mysql server and then restart the server?
If so, what would be the command?
| SitePoint Sponsor |


I'd like to know is there a way that I can run a cron-job to reset the mysql server and then restart the server?
If so, what would be the command?
you have to have enough access to do this, you know? are you just wanting to restart MySQL? this is how i've seen it done, so i guess you'd use these commands in cron to stop MySQL and then start it again.
/etc/rc.d/init.d/mysql stop
/etc/rc.d/init.d/mysql start
dunno if that'll work. that's what i've seen though!![]()
- Matt
Dr.BB - Highly optimized to be 2-3x faster than the "Big 3."
"Do not enclose numeric values in quotes -- that is very non-standard and will only work on MySQL." - MattR


If you don't mind me asking, why do you need to do such a thing? If anything goes wrong during the reboot you could be in for some serious downtime!


Be honest with yourself, when have you experienced trouble during a reboot?
Personally, it's never happened. But here's my rationalization.
1. I'm not a Linux person.
2. My server isn't where I live.
Therefore, if I reset it, it doesn't matter if it doesn't come back up 'cause I wouldn't know what to do to fix it anyway.
My site gets a lot of traffic. I have over 60,000 users and over 600,000 posts in my forums. (That's a little bit more than Site Point [no disrespect intended]) The server was running fine for 51 days without one restart but today it was sluggish and a nice reboot fixed the problem.
But thanks for your concern.


Granted, I have never had trouble with a reboot -- but expect the unexpected is an important phrase.![]()
Um. Cron jobs are scripts run automatically at certain time increments. If you always need to restart your server after X amount of uptime than something is seriously broken and you should fix it instead of avoiding the problem.I'd like to know is there a way that I can run a cron-job to reset the mysql server and then restart the server?
Bookmarks