The server quit without updating PID file (/usr/local/var/mysql/NAME.pid)

Solution 1:

YES.

Following homebrew caveats, did you setup launchd?

To have launchd start mysql at login:
    ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
Then to load mysql now:
    launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

Well, now using mysql.server is pointless. It basically doesn't work, because (from my poor understanding) mysqld is now managed by launchd, and it is mysqld_safe. I don't know if actually because of that is different from what you control with mysql.server.

The solution I came up with is to not use launchd for mysql from brew. Rather, I just use the mysql.server tool to start, stop, and restart mysql.

If you want to follow my steps, this is what you need to do:

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

And whenever you want to start the mysql server, use mysql.server start.

If you actually want to make mysql start at boot time, you can take that plist and copy it, delete the KeepAlice line, replace the string values under ProgramArguments with /usr/local/bin/mysql.server and start. After that do
launchctl load ~/path/to/com.file.plist

Solution 2:

What worked for me was sudo chmod -R 777 /usr/local/mysql/ , I've had installed from brew.