Starting, stopping, or restarting MySQL

Starting or stopping MySQL in Linux (CentOS)

service mysqld start
service mysqld stop
service mysqld restart

Restarting MySQL should only take a second or so. I would be surprised if many of your users noticed that you did it. In saying that, don’t do it unless you have spare time to deal with a failure to restart. You might have made a mistake in the config file and that can stop MySQL starting again.

Your database might appear slower immediately following a restart. This is normal, because you have lost all your cached data/queries. You shouldn’t experience too much of a slow down, but it’s worth noting, just in case.

Starting, stopping, or restarting Apache

Starting or stopping Apache in Linux (CentOS)

service httpd start
service httpd stop
service httpd restart

Restarting Apache should only take a second or so if everything goes well. I would be surprised if any of your users noticed that you did it. In saying that, don’t do it unless you have spare time to deal with a failure to restart. You might have made a mistake in one of the config files and that can stop Apache starting again. I am speaking from experience, where I have forgotten which change I made and spent at least ten minutes finding the syntax error.

Using nano to edit the cron

On my first web server (CentOS), when I edited my cron it opened up using nano. Unfortunately my second web server, again CentOS, opened the cron using vi. To setup nano as the default editor for your cron, you can do the following

export EDITOR=nano

Of course you could use any editor as your default, but I like nano.

You can do this once every session, or you can add it into your login script and you never need to type it in again.