How to stop mysqld process?
Matthew Harrington
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.
7 Answers
/etc/init.d/mysql stop
service mysql stop
killall -KILL mysql mysqld_safe mysqldWhen you see the following information, you success
mysql: no process found
mysqld_safe: no process found
mysqld: no process foundI 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 existsJust completely stop the mysqld, mysqld_safe, mysql solves the problem
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/' ; thenThe 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 3 Run sudo /etc/init.d/mysql stop
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/
/etc/systemd/system/snap.nextcloud.mysql.service
/etc/apparmor.d/abstractions/mys 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 stopThis worked in Ubuntu WSL.
2If you are stuck in a running commang inside the console, you can try one of the following.
- Ctrl + c
- Ctrl + q
- F10
- type "exit" + Enter
- Esc
System Preferences -> MySql -> Stop MySQL Server
This is the only one that worked for me, stopping / killing it from the command line would always let it restart.