LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-07-2012, 01:10 PM   #1
wills
LQ Newbie
 
Registered: Jun 2008
Posts: 28

Rep: Reputation: 0
restarting mysql via /etc/init.d/mysqld restart


This morning I had to restart the MySQL service because someone in our organization couldn't do it for some reasons. The person that asked me to restart had made my.cnf configuration changes. There was nothing really wrong with the server other than he couldn't restart it.

Shortly, after doing this, I got an email with the following from someone else:

Quote:
It is my understanding that mysqld restart is a cold and rude shutdown, the equivalent of a crash, on production, do this only if you have no other choice. Instead use mysqladmin shutdown to stop the service and mysqld start to start it.
Is there any merit to this statement?
 
Old 03-07-2012, 02:55 PM   #2
thinknix
Member
 
Registered: Nov 2008
Distribution: Lots!
Posts: 178

Rep: Reputation: 58
False. At least on Debian, the mysql init script handles a restart action by first trying to send a SIGTERM to the mysqld process to gracefully stop it (EDIT: Just checked a CentOS 5.4 box, it also sends an initial SIGTERM). Only if the process does not respond to the initial SIGTERM does it issue the SIGKILL, which would be forceful (and necessary at that point). The mysql documentation specifically mentions using SIGTERM to shutdown mysql on Unix-based OSes (from http://dev.mysql.com/doc/refman/5.0/...hutdown.html):

Quote:
1. The shutdown process is initiated.

This can occur initiated several ways. For example, a user with the SHUTDOWN privilege can execute a mysqladmin shutdown command. mysqladmin can be used on any platform supported by MySQL. Other operating system-specific shutdown initiation methods are possible as well: The server shuts down on Unix when it receives a SIGTERM signal.

Last edited by thinknix; 03-07-2012 at 03:00 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] MySQL Start Problem::::socket '/var/run/mysqld/mysqld.sock' (2) arun-linux Linux - Software 6 11-29-2012 06:56 AM
[SOLVED] Ubuntu - Apache web server not restarting /etc/init.d/apache2 restart nonshatter Linux - Software 2 12-03-2011 09:33 AM
Can't connect to local MySql server through socket '/var/run/mysqld/mysqld.sock' (2) thoufiq Linux - Server 4 04-19-2011 04:35 AM
/etc/init.d/mysql restart problem meenalborkar Debian 3 11-11-2005 07:40 AM
Restarting mysql database on restart psycho2000 Linux - Newbie 3 06-01-2003 08:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration