Remove one of the two instances of MySQL?
Solution 1
You can use find / -name mysql
to find all occurrences of mysql to find where mysql instances are installed.
Or you can have a look at /usr/local
. That's where normally external mysql-instances are installed to. If you find a mysql-folder in there you can safely remove that if you definitely do not need that one. Don't forget to remove the symbolic link also.
You should then also have a look at /Library/StartupItems
which could contain a folder named MSYQL-something (right now not sure about the exact name) which you can also delete. It's the stuff that start your MySQL-Database during the boot-process.
And then there's the MySQL-PreferencePane you can remove. It should be located at /Library/PreferencePanes
. Simply move it to the Trash and be happy.
Solution 2
You can check the pid from the 2nd column from
sudo lsof | grep mysql.sock
would result
mysqld 303 _mysql 12u unix 0x54d946e8e8d9b067 0t0 /tmp/mysql.sock
with the pid, you can have list the instances with ps axu | grep mysql
, where the 2nd column is the pid.
Related videos on Youtube
Mike Perrenoud
Mike Perrenoud is a 19-year veteran developer, polyglot, mentor and all around nice guy. He enjoys helping people and making a difference in their lives.
Updated on September 18, 2022Comments
-
Mike Perrenoud over 1 year
Objective
I want to get rid of one of the two instances of MySQL on my iMac.
History
A while back I installed one just to play around with it - but then I ended up installing a MAMP stack so that I could do PHP development. When I did that it installed a version of MySQL as well - so now I have two of them running.
Research
So, I ran a
netstat -n | grep mysql
and got back the following results:However, I don't know how to get the one that's not in the MAMP directory off of my machine. Please direct me. Thanks!
-
Mike Perrenoud over 11 yearsOK, from there how do I remove that instance of MySQL completely from my Mac?
-
Scott - Слава Україні almost 7 yearsHow, exactly, does this address the issue of there being two copies of MySQL (and the OP wanting to remove only one of them)?
-
yongrui almost 7 yearsthis will stop mysqld 303 _mysql 12u unix 0x54d946e8e8d9b067 0t0 /tmp/mysql.sock. and you can use mamp mysql without any issue