MYSQL PID / SOCK错误 - 我无法让我的Mac El Capitan使用完整的Web服务器

So I have been trying to get my localhost up on my brand new MacBook Air on OSX El Capitan.

What I have so far is PHP seems to be working correctly, Apache seems to be working correctly also, but mysql is giving me a headache.

I tried to install the stock version of mysql, which doesn't seem to work at all, it started and every time I tried to login to mysql it completely broke and I didn't see any error messages, but I guess it was the same I got for the homebrew installed version.

When I tried Homwbrew brew install mysql it worked correctly.

Then I tried mysql_secure_installation it threw and error: Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Then I tried mysql.server start and I got ... ERROR! The server quit without updating PID file (/usr/local/var/mysql/Szekelys-MacBook-Air.local.pid).

This is my third fresh install for Mac and I have no idea at this point.

I tried permissions, creating the PID file and a lot of other things.

I'm afraid that I've not got a solution for you. I'm in the same boat though. I have exactly the same error, and I've tried installing with brew as well as directly.

Even worse, I've got it working in my iMac, but not my Macbook Pro.

The only difference I can see is the version. I've got

mysql-5.6.26-osx10.8-x86_64

on the iMac, working well.

The one that's not working has:

mysql-5.7.9-osx10.9-x86_64

I'm going to try using the earlier revision, it's the only thing I've not tried yet.

I know this is weird, but I have been experiencing the same problem over and over and coming upon no useful answers like the rest of you, but somehow I happened upon something that DID work on this page

For some reason following the instruction to use mysql.server restart seemed to work. I didn't create any of the suggested launchctl versions either.

I suggest doing a hard cleanup of homebrew brew cleanup --force -s to make sure you get a new download.