25

I can start MySQL fine,

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

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
ZygD
  • 317
  • 1
  • 3
  • 11
simpleengine
  • 395
  • 1
  • 3
  • 6
  • This can be caused by so many factors, i.e. permissions, ownership, corrupted data - to see a summary of how to determine which one, check this article: https://medium.com/@7anac/mysql-error-the-server-quit-without-updating-pid-file-ce320ff75828 – Janac Meena May 08 '20 at 13:51

4 Answers4

21

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!


EDIT: Alternative solution from @DanielTate

This worked for me JasperSoft Wiki - uninstall-mysql-mac-os-x. I had to brew uninstall mysql then delete ALL of the files then reinstall and follow the home brew install instructions


EDIT 2: Alternative solution from @JanacMeena

There is a nice write-up of their solution in this post on Medium.

Rockin4Life33
  • 311
  • 3
  • 6
  • 2
    ERROR! The server quit without updating PID file – Nisanio Aug 07 '16 at 19:59
  • 1
    @Nisanio Along with `ERROR! The server quit without updating PID file` does it give reference to a .pid file? Maybe something similar to `ERROR! The server quit without updating PID file (/usr/local/mysql/data/..pid)` – Rockin4Life33 Aug 07 '16 at 20:13
  • 1
    This worked for me http://community.jaspersoft.com/wiki/uninstall-mysql-mac-os-x. I had to brew uninstall mysql then delete ALL of the files then reinstall and follow the home brew install instructions – Daniel Tate Aug 25 '16 at 02:31
  • @DanielTate Thanks for adding that in w/the link. Should be helpful to others! – Rockin4Life33 Aug 26 '16 at 16:31
  • 1
    `ps aux | grep [m]ysql` will help prevent grep from grepping itself – Snekse Apr 04 '19 at 15:40
  • @Nisanio did you figure out how to solve that issue? – Janac Meena May 05 '20 at 14:19
  • 1
    @JanacMeena I've updated my answer to include Daniel Tate alt solution from comments, in the case Nisanio doesn't get back to you w/a solution. Hopefully this helps unblock you, if not post back with more details; maybe I — or the community — can be of assistance – Rockin4Life33 May 06 '20 at 19:36
  • 1
    @Rockin4Life33 thanks for your response, but I was able to solve this issue by deleting my ibdata files and ib-log files. – Janac Meena May 06 '20 at 21:32
  • 1
    For reference, I documented my solution here: https://medium.com/@7anac/mysql-error-the-server-quit-without-updating-pid-file-ce320ff75828 – Janac Meena May 08 '20 at 13:51
  • 1
    @JanacMeena, thank you for the write-up on Medium and posting the link. I've updated the answer to contain your solution. – Rockin4Life33 May 08 '20 at 16:10
17

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/mysqld.pid

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

  mkdir /var/run/mysqld
  touch /var/run/mysqld/mysqld.pid
  chown -R mysql:mysql /var/run/mysqld
Daniel t.
  • 9,061
  • 1
  • 32
  • 36
  • 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/mysqld.pid` ?? – mOna Feb 29 '16 at 10:01
  • yes, if you are getting "PID file not found" error. – Daniel t. Mar 02 '16 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/mysqld.pid).` do u have any idea?! :| – mOna Mar 11 '16 at 14:18
  • http://stackoverflow.com/questions/4963171/mysql-server-startup-error-the-server-quit-without-updating-pid-file – Daniel t. Mar 12 '16 at 06:16
  • I did the above step and still getting error: [15:57:53][~]#sudo mysql.server restart ERROR! MySQL server PID file could not be found! Starting MySQL .. ERROR! The server quit without updating PID file (/var/run/mysqld/mysqld.pid). – gvanto Dec 06 '19 at 13:59
0

I had this problem too... In my case,I used Generic MySql version, I run mysql as root user :

/path/to/mysql/support-files/mysql.server start --user=root
ultra.deep
  • 141
  • 6
0

Underlying issue is probably that your hostname is changing and if you do not specify the pid-file in my.cnf it will use .pid as the file. If I have my MacBook at home I will see one hostname but when it wakes up on the corporate network it will see the same name with ".local" at the end.