FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux General Discussion

 
 
LinkBack Thread Tools
 
Old 03-24-2010, 01:46 AM
Carlos Mennens
 
Default MySQL Starts But Fails to Restart

I don't understand this issue so I am posting this here. I noticed
today that I had an issue with restarting MySQL on my server:

1. I verify MySQL is not running:

Code:

[root@ghost /]# ps -ef | grep -i "mysqld"
root 1706 1216 0 16:45 pts/0 00:00:00 grep --color=auto -i mysqld

2. I start the 'mysqld' service:

Code:

[root@ghost /]# /etc/rc.d/mysqld start
:: Starting MySQL Server
[DONE]

3. I verify that the daemon is running:

Code:

[root@ghost /]# ps -ef | grep -i "mysqld"
root 1715 1 0 16:45 pts/0 00:00:00 /bin/sh
/usr/bin/mysqld_safe --datadir=/var/lib/mysql
mysql 1813 1715 0 16:45 pts/0 00:00:00 /usr/sbin/mysqld
--basedir=/usr --datadir=/var/lib/mysql --user=mysql
--log-error=/var/lib/mysql/ghost.err
--pid-file=/var/lib/mysql/ghost.pid
--socket=/var/run/mysqld/mysqld.sock --port=3306

4. I then run the command to restart the daemon for MySQL and it fails...

Code:

[root@ghost /]# /etc/rc.d/mysqld restart
:: Stopping MySQL Server

[DONE]
:: Starting MySQL Server

[FAIL]

I can use the 'start' and 'stop' commands for /etc/rc.d/mysqld but
'restart' for some reason fails and this concerns me. Can anyone help
me understand what is wrong?
 
Old 03-24-2010, 06:39 AM
Jan de Groot
 
Default MySQL Starts But Fails to Restart

When you stop MySQL, the kill command completes immediately, while MySQL
is still doing shutdown tasks to make sure the database is in a
consistent state. As MySQL is still running when you try to start it, it
will fail to do so.
There's 2 ways to fix this:
- use mysqladmin shutdown, needs a user in the database with process
privileges, this is the way used by debian
- implement a loop that waits for MySQL to shutdown after executing the
kill command. This is what the upstream MySQL start/stop script does.

On Tue, 2010-03-23 at 22:46 -0400, Carlos Mennens wrote:
> 4. I then run the command to restart the daemon for MySQL and it fails...
>
> Code:
>
> [root@ghost /]# /etc/rc.d/mysqld restart
> :: Stopping MySQL Server
>
> [DONE]
> :: Starting MySQL Server
>
> [FAIL]
>
> I can use the 'start' and 'stop' commands for /etc/rc.d/mysqld but
> 'restart' for some reason fails and this concerns me. Can anyone help
> me understand what is wrong?
 

Thread Tools




All times are GMT. The time now is 09:52 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org