-1

On Yosemite, starting MySQL gives the following error:

The server quit without updating PID file

I have seen this question here and i have found the solution

           sudo chown -R mysql /usr/local/var/mysql/

But Can anyone please explain me why this solved the problem? And why the problem was raised in the first place?

Community
  • 1
  • 1
user3290349
  • 1,227
  • 1
  • 9
  • 17
  • Item #2 in [this answer](https://stackoverflow.com/a/8137439/62576) to the post you linked explained why it solves the problem. What part of that isn't clear? – Ken White Jun 19 '15 at 18:26

1 Answers1

0

mysqld creates a "PID file" that contains the Process ID of the mysqld process. It will refuse to start if that file exists, because that usually means mysqld is still running. In this case, however, mysqld was forcefully stopped and had no chance to delete its PID file. Running sudo chown -R mysql /usr/local/var/mysql/ will delete it, but don't do that unless you know there's no other mysqld processes running. (ProTip™: Find the PID in the PID file then kill it to make sure. I am not responsible for any losses with that method (especially killing another process other than MySQL).)

Piper McCorkle
  • 1,044
  • 13
  • 27