Linode Forum Index Linode Forum
Linode Community Forums
 


MySQL will not shut down

Click here to go to the original topic

 
       Linode Forum Index -> Linux Tips, Tricks, Tutorials
Author Message
kpm



Joined: 20 Jan 2008
Posts: 25

Posted: Tue Apr 13, 2010 11:47 pm    Post subject: MySQL will not shut down  

I have two Linodes, one a web server, the other a place for backups. I set up the backup server to also be a MySQL replication server so I could then take database backups with automysqlbackup script. It works great.

I recently posted about not being able to get MySQL to run after I upgraded the web server from Ubuntu 8.10 to 9.10. That problem was resolved by commenting out "skip-bdb" in my.cnf.

I have since moved on to begin upgrading the backup server from Ubuntu 8.10 to 9.10. Now, I have the opposite problem. I cannot get MySQL to stop so that I can begin the upgrade.

I've tried Code: /etc/init.d/mysql stop but MySQL keeps on going.
I've tried Code: killall mysql and get returned "no process killed."

Each time I attempt to run Code: apt-get upgrade I get the following error:
Code: Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be upgraded:
  apache2 apache2-mpm-prefork apache2-utils apache2.2-common dhcp3-client
  dhcp3-common libapache2-mod-php5 libcups2 libcupsimage2 libexpat1 libkrb53
  libpng12-0 libpq5 libssl0.9.8 libthai-data libthai0 mysql-server
  mysql-server-5.0 openssl php5 php5-cli php5-common php5-curl php5-gd
  php5-mysql python2.5 python2.5-minimal sudo tzdata
29 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
3 not fully installed or removed.
Need to get 0B/43.9MB of archives.
After this operation, 53.2kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Preconfiguring packages ...
(Reading database ... 18393 files and directories currently installed.)
Preparing to replace mysql-server 5.0.67-0ubuntu6 (using .../mysql-server_5.0.67-0ubuntu6.1_all.deb) ...
 * Stopping MySQL database server mysqld
   ...fail!
invoke-rc.d: initscript mysql, action "stop" failed.
invoke-rc.d returned 1
There is a MySQL server running, but we failed in our attempts to stop it.
Stop it yourself and try again!
dpkg: error processing /var/cache/apt/archives/mysql-server_5.0.67-0ubuntu6.1_all.deb (--unpack):
 subprocess pre-installation script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/mysql-server_5.0.67-0ubuntu6.1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Can anyone point me in the right direction to a solution?
Back to top  
obs



Joined: 07 Mar 2010
Posts: 1400
Location: Earth

Posted: Wed Apr 14, 2010 1:26 am    Post subject:  

As root run the following

ps -A | grep mysql

grab the pids then run

kill pid (replace pid with the pids you got) do it for each process.

If kill pid doesn't work use

kill -9 pid (where pid is the id of the process)

You must run mysqlcheck on restarting your server after running kill -9 since it kills and doesn't allow for a clean shutdown.

Remember it may take a few seconds for mysql to shutdown cleanly.
Back to top  
kpm



Joined: 20 Jan 2008
Posts: 25

Posted: Sat Apr 17, 2010 8:50 pm    Post subject: thanks  

that did it.

I had to use kill-9 on a mysqld process, but after that, I was able to continue on with the upgrade.

Cheers
Back to top  
bnlf



Joined: 22 Apr 2010
Posts: 4

Posted: Thu Apr 22, 2010 12:25 pm    Post subject:  

yea happened to me when i migrated from dallas to atlanta cluster. In the background it seems to be a permission problem. I did exactly as you

1)kill the process
2)upgraded mysql (reinstall should work as well just need to keep conf files)

all works :)
Back to top  
 
       Linode Forum Index -> Linux Tips, Tricks, Tutorials
Page 1 of 1