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 /etc/init.d/mysql stop but MySQL keeps on going.

I've tried killall mysql and get returned "no process killed."

Each time I attempt to run apt-get upgrade I get the following error:

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?

3 Replies

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.

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

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 :)

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct