Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mysql process cannot be stopped

I have recently installed 5.5.28-29.2 Percona Server (GPL), Release 29.2 in a Ubuntu 12.04 OS Desktop. I have tried to stop the server using different methods:

- sudo /etc/init.d/mysql stop - sudo kill -9 pid - mysqladmin -u root -p shutdown 

All this methods stop the process, however it starts up automatically after it dies. I have checked syslog (/var/log/syslog/) and always shows me the next trace:

Jan  4 17:50:44 kernel: [ 1915.494219] init: mysql main process (17311) killed by KILL signal Jan  4 17:50:44 kernel: [ 1915.494245] init: mysql main process ended, respawning Jan  4 17:50:44 kernel: [ 1915.500025] type=1400 audit(1357318244.557:48): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=18458 comm="apparmor_parser" Jan  4 17:50:46 /etc/mysql/debian-start[18501]: Upgrading MySQL tables if necessary. Jan  4 17:50:46 /etc/mysql/debian-start[18504]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored Jan  4 17:50:46 /etc/mysql/debian-start[18504]: Looking for 'mysql' as: /usr/bin/mysql Jan  4 17:50:46 /etc/mysql/debian-start[18504]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck Jan  4 17:50:46 /etc/mysql/debian-start[18504]: This installation of MySQL is already upgraded to 5.5.28, use --force if you still need to run mysql_upgrade Jan  4 17:50:46 /etc/mysql/debian-start[18515]: Checking for insecure root accounts. Jan  4 17:50:46 /etc/mysql/debian-start[18520]: Triggering myisam-recover for all MyISAM tables 

Do you know the reason why the process restarts automatically ? Thank you in advance!!

like image 808
ljmelgui Avatar asked Jan 04 '13 16:01

ljmelgui


People also ask

How do I stop a process in MySQL?

Login to DB; Run a command show full processlist; to get the process id with status and query itself which causes the database hanging; Select the process id and run a command KILL <pid>; to kill that process.

Can't stop MySQL server?

This issue usually results from an incorrect service name reference. This arises when the MySQL Workbench contains a reference to an older service name (e.g. mysql), whereas MySQL Server 8.0. x uses the service name MySQL80.

What does mysqld command do?

mysqld, also known as MySQL Server, is a single multithreaded program that does most of the work in a MySQL installation. It does not spawn additional processes. MySQL Server manages access to the MySQL data directory that contains databases and tables.


2 Answers

I was having this exact same problem. Running the kill command would kill the process, but in my case it would keep popping up again under a different process ID.

The only way I could figure out how to stop it for good was this:

sudo stop mysql 

Hope that helps.

Source: http://www.itfromscratch.com/how-to-stop-the-percona-mysql-server/

like image 131
The New Guy Avatar answered Sep 22 '22 23:09

The New Guy


Using sudo service mysql stop worked for me.

like image 36
alessio Avatar answered Sep 22 '22 23:09

alessio