29
19
When I run sudo kill -9 [PID]
with the proper process ID, the process stops but then is restarted and has a new PID. I'm trying to kill the mysqld
process.
How can I mimic the Activity Monitor in killing a process? In the Activity Monitor, when you press "Quit Process", the process permanently stops running, it is totally terminated. I figure that kill
will do the same thing right?
I had both the Activity Monitor and the terminal next to each other to see if the command works, but every time I do sudo kill -9 [PID]
, the process in Activity monitor doesn't go away, it just refreshes with a new PID.
So... how do I kill the mysqld
process via the terminal?
Ouch! Don't use -9 unless you REALLY need to. It's a violent thing to do to a process. Other signals allow a process to terminate in an orderly manner, but not -9! So it means that RAM buffers don't get flushed to disk, for example. This is a particularly bad thing to do to a database that is in the process of doing work; you'll come back to damaged tables. – Jan Steinman – 2018-03-04T02:21:13.177
I did it from the activity monitor because the 'kill' command was not recognising the PID. Again unlike your case my mysqld did not restart as soon as I killed it from the Activity monitor. – Yoosaf Abdulla – 2013-09-28T13:46:13.923