Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 can start mysql fine,

/usr/local/mysql/support-files/mysql.server start
Starting MySQL

But any mysql action after that I get the error: MySQL server PID file could not be found

/usr/local/mysql/support-files/mysql.server stop
ERROR! MySQL server PID file could not be found!

Where do I find the server PID file on Mac with OSX 10.8? I am wondering if it is a permission problem. The mysql.sock file is a symlink pointing to the file in the tmp/ directory.

sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock

Any help appreciated

share|improve this question
up vote 7 down vote accepted

In your mysql configuration file - my.cnf, check for the parameter pid-file and see where it points. If it is not there, set it manually to -

pid-file    = /var/run/mysqld/

Create the directory /var/run/mysqld/ and give it proper permissions -

  mkdir /var/run/mysqld
  touch /var/run/mysqld/
  chown -R mysql:mysql /var/run/mysqld
share|improve this answer
Okay, I am trying this. I will let you know how it goes – simpleengine Feb 20 '13 at 23:29
Great, you are a genius. It works. The only thing that was missing was the line pid-file in my.cnf I had to run /usr/local/mysql/support-files/mysql.server restart twice to remove the error – simpleengine Feb 20 '13 at 23:34
I cannot find pid-file in my.cnf .. could I add this line pid-file = /var/run/mysqld/ ?? – mOna Feb 29 at 10:01
yes, if you are getting "PID file not found" error. – Daniel t. Mar 2 at 23:32
@Danielt.thanks for your reply. I tried what you said.. the error is now changes to ERROR! The server quit without updating PID file (/var/run/mysqld/ do u have any idea?! :| – mOna Mar 11 at 14:18

This question is a bit outdated but I thought I'd post how I resolved this issue when it happened to me on my Mac (OS X El Capitan 10.11.4).

Check the status just to be sure

mysql.server status

ERROR! MySQL is running but PID file could not be found

Find all running mysql processes

ps aux | grep mysql

It will list out all the processes using mysql (including the command you just executed)

Kill off all the mysql pids

sudo kill <pid1> <pid2> <pid3> ...

This should kill off all the mysql processes

Now try to fire mysql up

mysql.server start

Starting MySQL . SUCCESS!

Hope this helps someone!

share|improve this answer

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.