How to stop mysqld process?
Solution 1
The mysql
Upstart configuration has the respawn
option:
$ grep respawn /etc/init/mysql.conf
respawn
respawn limit 2 5
elif echo $statusnow | grep -q 'respawn/' ; then
The respawn
option tells Upstart to restart the process if it exits or is killed.
The limit is 2, so you can try killing of the processes twice, which will tell Upstart not to start them again, or use:
sudo service mysql stop
Solution 2
/etc/init.d/mysql stop
service mysql stop
killall -KILL mysql mysqld_safe mysqld
When you see the following information, you success
mysql: no process found
mysqld_safe: no process found
mysqld: no process found
I use this to solve the installation problem of MySQL 5.6 in Ubuntu 15.10 using this link.
During this installation, I encounter the problem saying:
mysqld_safe A mysqld process already exists
Just completely stop the mysqld, mysqld_safe, mysql solves the problem
Solution 3
Run sudo /etc/init.d/mysql stop
Solution 4
If you cannot find mysql within /etc/init
or /etc/init.d
, check that id did not come together with another package.
As for me, i found out that my mysqld runs to support nextcloud, i did
$> find '/etc' | grep 'mysql'
/etc/systemd/system/multi-user.target.wants/snap.nextcloud.mysql.service
/etc/systemd/system/snap.nextcloud.mysql.service
/etc/apparmor.d/abstractions/mys
Solution 5
Somehow all the answers couldn't help me until I first restarted the server then stopped it, so here are the steps:
sudo /etc/init.d/mysql restart
sudo /etc/init.d/mysql stop
This worked in Ubuntu WSL.
Related videos on Youtube
Manoj Bharadwaj
Want to learn about Ubuntu and free softwares.
Updated on September 18, 2022Comments
-
Manoj Bharadwaj over 1 year
result of
ps -e | grep mysqld
running
htop
and clicking on memory usage..It is taking 33% of 4gb memory.
I just want to end the mysqld process.. running
sudo pkill mysqld
ends the process but again the process starts.. I want to completely end it and get the memory back.-
Admin over 9 yearsPress f5 in htop to see what process is starting mysqld
-
-
Jānis Elmeris almost 8 years
mysql stop
stops it, and yet it still starts again and again... I commented out respawn rows in the configuration, but that didn't help. -
muru almost 8 years@Janis if
service mysql stops
mysql, and then it restarts, then something else is starting it. Look for cronjobs or monitoring scripts or something. -
Jānis Elmeris almost 8 yearsThanks! I did the stopping by
/etc/init.d/mysql stop
, but it turned out that I had to runservice mysql stop
instead. I thought that they are the same (one calling the other or both calling the same command). -
abu_bua almost 6 yearsduplicate of this answer askubuntu.com/a/771591/790920
-
Eddy Ekofo almost 6 years@abu_bua I tried the steps he put there and it still didn't work for me until I restarted and then stropped, that's why I have it specific steps in that order if anyone has same problems.