Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just installed xampp on my mac os x. When I tried start mysql it displays a message that mysql is already running on this computer. In order to start mysql stop first mysql. I tried following ways to stop it but neither of them works.

mysqladmin version
sudo /usr/local/mysql/mysql.server stop //mysql.server command not found
mysqladmin -u root -p password shutdown //restarts the server but not shutdown

when i use which mysql command it shows this path


and when I issue ps aux | grep mysqld command I get following output

zafarsaleem    85209   0.0  0.3  2699804  13204   ??  S     7:51AM   0:00.88        /Applications/MAMP/Library/bin/mysqld --basedir=/Applications/MAMP/Library --datadir=/Applications/MAMP/db/mysql --plugin-dir=/Applications/MAMP/Library/lib/plugin --lower-case-table-names=0 --log-error=/Applications/MAMP/logs/mysql_error_log.err --pid-file=/Applications/MAMP/tmp/mysql/ --socket=/Applications/MAMP/tmp/mysql/mysql.sock --port=8889
zafarsaleem    85093   0.0  0.0  2435488    924   ??  S     7:51AM   0:00.03 /bin/sh /Applications/MAMP/Library/bin/mysqld_safe --port=8889 --socket=/Applications/MAMP/tmp/mysql/mysql.sock --lower_case_table_names=0 --pid-file=/Applications/MAMP/tmp/mysql/ --log-error=/Applications/MAMP/logs/mysql_error_log
zafarsaleem    86693   0.0  0.0  2425480    180 s004  R+    8:30AM   0:00.00 grep mysqld
zafarsaleem    86507   0.0  0.3  2678756  11364   ??  S     8:07AM   0:00.63 /usr/local/Cellar/mysql/5.5.20/bin/mysqld --basedir=/usr/local/Cellar/mysql/5.5.20 --datadir=/usr/local/var/mysql --plugin-dir=/usr/local/Cellar/mysql/5.5.20/lib/plugin --max-allowed-packet=32M --log-error=/usr/local/var/mysql/Zafars-MacBook-Pro-2.local.err --pid-file=/usr/local/var/mysql/
zafarsaleem    86447   0.0  0.0  2435488    920   ??  S     8:07AM   0:00.02 /bin/sh /usr/local/bin/mysqld_safe --max_allowed_packet=32M

How can I resolve this issue?


When I issue this command launchctl list then I do see mysqld in the list as follows
-           0
1201    -   homebrew.mxcl.mysql                    <--
443         -   homebrew.mxcl.mongodb
-           0
-           0   com.adobe.ARM.df0ab5bbe6f698196fcc21e3c1e66dcb758bd911f4d637272d9d8109
-           0   com.adobe.AAM.Scheduler-1.0
45          -   0x7fd1bba073e0.anonymous.loginwindow
-           1
1261    -    0x7fd1bba0c6e0.anonymous.mysqld        <--
 212    -   0x7fd1ba5206d0.anonymous.launchd
 230    -   0x7fd1ba5203d0.anonymous.Terminal

Secondly when I tried to issue below command as mentioned by @PunjCoder

sudo launchctl unload -w /Library/LaunchDaemons/org.macports.mysql.plist
OUTPUT for above is:
launchctl: Couldn't stat("/Library/LaunchDaemons/org.macports.mysql.plist"): No    such file or directory
nothing found to unload

sudo launchctl unload -w /System/Library/LaunchDaemons/org.macports.mysql.plist
OUTPUT for above is:
launchctl: Couldn't stat("/System/Library/LaunchDaemons/org.macports.mysql.plist"): No such file or directory
nothing found to unload

So what can I do to stop them and how? I am very new to mac os x so don't really know how to resolve this issue. Please help...

share|improve this question
You might want to check out Mamp instead of Xampp, I find it working much easier and better than Xampp. – Rob Feb 11 '14 at 11:20

I always use the activity monitor to quit mysql. I'm not sure why it would show up there and not on the commond line, but it is worth a try.

share|improve this answer
I tried that but it is also not exiting from activity monitor. – al0ne evenings Oct 29 '12 at 7:29
It does show up in activity monitor? If it does you should be able to force quit it form there. – Laura Oct 29 '12 at 16:31
It is there but unfortunately it is keep restarting when I force quit mysql server with another Process ID. – al0ne evenings Oct 30 '12 at 6:46
Take a look a here: or here: – Laura Oct 30 '12 at 10:24
I already followed them and if you see me updates in my post you will find out. – al0ne evenings Oct 30 '12 at 10:28

Your MYSQL instance that is running is here /Applications/MAMP/Library/bin/mysqld (the MAMP one) and here /usr/local/Cellar/mysql/5.5.20/bin/mysqld (the one installed using Brew).


/Applications/MAMP/Library/bin/mysqladmin shutdown
/usr/local/Cellar/mysql/5.5.20/bin/mysqladmin shutdown

Then start the one you want to start. You also would want to check Library/LaunchDaemons/ for any launch scripts and use something like

sudo launchctl unload -w /Library/LaunchDaemons/org.macports.mysql.plist

Update: Please list the output of following commands: ls /System/Library/LaunchDaemons/ | grep mysql ls /Library/LaunchDaemons/ | grep mysql ls ~/Library/LaunchDaemons/ | grep mysql

share|improve this answer
I followed your instructions. Here is what I did: I first issue ps aux | grep mysqld. THEN I execute this command /usr/local/Cellar/mysql/5.5.20/bin/mysqladmin shutdown but I am getting this error /usr/local/Cellar/mysql/5.5.20/bin/mysqladmin: shutdown failed; error: 'Access denied; you need (at least one of) the SHUTDOWN privilege(s) for this operation'. – al0ne evenings Oct 30 '12 at 5:39
Please see my updated post as well – al0ne evenings Oct 30 '12 at 5:59
Please list the output of following commands: ls /System/Library/LaunchDaemons/ | grep mysql ls /Library/LaunchDaemons/ | grep mysql ls ~/Library/LaunchDaemons/ | grep mysql – PunjCoder Nov 7 '12 at 19:46

just restart the .dml file in your account

share|improve this answer

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

How exactly is this done? – grgarside Mar 11 at 8:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.