Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have MySQL 5.1.45 running on a RedHat box. We needed to shut the box down for maintenance last week and had an issue.

We first closed down all connections. Then we ran the MySQLAdmin/shutdown command. The database appeared to hang. We waited for 30 minutes before trying Ctrl-C which gave us an error and we had to end up physically cycling the box.

This caused corruption and it took us 1.5 hours to get everything fixed.

Most of the documentation I can find points to InnoDB problems, but we are using MyISAM.

Is there a better way to shut down MySQL than running the Shutdown command? Is there a way to force MySQL to shut down when it appears to hang?

share|improve this question
    
Why did you not try the service mysqld stop command first? Were you not able to do that? If so, what was the error? The stop code of the init script seems to do a proper kill (SIGTERM) of the process along with proper cleanup of lock files and such. I've always used that to stop MySQL and never had problems with corruptions before. –  Yanick Girouard Feb 22 '12 at 5:08
    
The database hanged. We were unable to try any more commands from that screen. In hind sight we should have opened another connection to see if we could still send a command. –  user1223424 Feb 22 '12 at 13:43
    
I don't understand. What do you mean by "the database hanged"? Don't you have root shell access to the server to manage the MySQL service? –  Yanick Girouard Feb 22 '12 at 13:55
    
Meaning we started the shutdown service. 120217 11:59:01 [Note] Event Scheduler: Purging the queue. 0 events Then the prompt was unresponsive. After 30 minutes we cycled the box and it came back online. 120217 12:34:06 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql –  user1223424 Feb 22 '12 at 14:09
    
Sorry if I seem thick, but which prompt are you talking about? The ssh bash prompt? –  Yanick Girouard Feb 22 '12 at 14:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.