Kill Mysql service running on any port, Mac Sierra

11,156

Solution 1

sudo pkill mysql should serve your purpose.

If for some reason mysqld survives this, sudo pkill mysqld as well.

More information from SuperUser: https://superuser.com/questions/983969/how-to-kill-mysql-with-moving-pid

Solution 2

Simplifying your answer.

1) Go to Launchpad Type Terminal then Run this.

2) Run following commands

Check if Mysql service is running

For all listening ports

netstat -vanp tcp

Apply port filter

netstat -vanp tcp | grep

netstat -vanp tcp | grep 3306


Kill Mysql Service

sudo pkill mysql

or
sudo pkill mysqld

< Enter password >

Done !!!

Share:
11,156
Suraj Shingade
Author by

Suraj Shingade

Fullstack Developer, Java AngularJS, ReactJS, NodeJS, Objective C, Spring Hibernate, micro services, Jhipster, Java 11, Angular 7, Typescript, Android, ios, Micro services

Updated on June 13, 2022

Comments

  • Suraj Shingade
    Suraj Shingade about 2 years

    Kill Mysql service running on any port using terminal. Port number like 3306 or any.

  • Benny64
    Benny64 about 2 years
    This works perfectly. Initially used sudo kill -9 <PID> but MySQL gets assigned another Process Identification Number instead. After using the suggestion above, when you run sudo lsof -i :3306 to check for processes running on port 3306, you should see nothing.