Resources:
Http://www.cnblogs.com/macro-cheng/archive/2011/10/25/mysql-001.html
http://blog.csdn.net/justaipanda/article/details/50531359
The simplest way to install MySQL on an OS X platform is to use the official web page to download the community version of the DMG package for installation. Currently the latest version is 5.7, and reference 1 has described the installation method, except for the 5.5 version of the installation, the difference is that the 5.7 version of the installation only need to run a setup program, and not like 5.5 need to install several programs, so the installation process is simpler.
After the installation is complete, a dialog box appears, as shown in. It provides a list of the default local root account login password, the password is randomly generated, the user in the first login is necessary to re-modify, of course, I use mysqlworkbench, the modification is particularly convenient.
After installation, do not rush to log in to MySQL, because this service is not turned on by default, otherwise you will be prompted with the error message shown below.
2002 (HY000): Can'/tmp/mysql.sock' (2)
You will first need to find the installed MySQL settings option in OS X's "System Preferences" as shown in.
Select this option, then the dialog appears as shown, you can see the current status of "Stopped", click the "" button next to enter the administrator password, you can see the MySQL service has been started. This is where you can log in to MySQL via the command line or client and do your database operation.
MySQL environment build on OS x platform