A lot of similar online, mostly said to modify the my.cnf, in my case does not work, in addition, many are Linux under, tried for a long time, the final reason is quite simple: MySQL service did not get up.
Because the Mysql.sock file is not very familiar, the beginning of a very large time wasted on this, after the reload is not, and then entered the/usr/local/mysql/bin/under the use of Mysqld start, the following problems occur
Okay, I started with root, and the results came back.
Please read "Security" sections of the manual to find out how to run mysqld as root!
Finally know, MySQL for security, do not want the root user to start MySQL directly, on this issue, you can refer to (http://blog.csdn.net/jubincn/article/details/6725582). So, the final solution is
sudo./mysqld--user=root
Mac OS x under MySQL appears can ' t connect to local MySQL server through socket '/tmp/mysql.sock ' (2) issue