Search code examples
mysqldockermacosprocess

how to kill mysql processes


My docker-compose command won't run because I have these processes running:

$ sudo lsof -nP +c 15 | grep LISTEN | grep sql
mysqld          113           _mysql   19u     IPv6 0xd0786f05dec2ff3f         0t0      TCP *:3306 (LISTEN)
mysqld          113           _mysql   22u     IPv6 0xd0786f05dec789ff         0t0      TCP *:33060 (LISTEN)

Every time I kill the process listed, it starts up again with a new PID.

I've already uninstalled it:

$ brew uninstall mysql
Error: No such keg: /usr/local/Cellar/mysql

How can I totally and permanently kill this?

I've tried

sudo /usr/local/mysql/bin/mysqld stop

and

/usr/local/mysql/bin/mysqladmin -u root -p shutdown 

When I try:

sudo mysql.server stop

It shows:

ERROR! MySQL server PID file could not be found!

but I still see new processes running for mysqld


Solution

  • (1) Search process by port sudo lsof -i tcp:3306 (2) Kill by userid pkill -u UID