Steps:
1. Download MySQL installation package MYSQL-5.7.13-OSX10.11-X86_64.BMG installation
2, after the completion of installation terminal input:
MySQL--version
----Show the version number is normal, if the command not found, in the terminal input as follows, "/usr/local/mysql/bin/mysql" is the MySQL default installation path:
$ cd/usr/local/bin/
$ sudo ln-fs/usr/local/mysql/bin/mysql mysql
3. Turn off the MySQL service:
Sudo/usr/local/mysql/support-files/mysql.server stop
4, configure the root account password, the default is not configured,
-----Input in terminal (start MySQL in safe mode):
Sudo/usr/local/mysql/bin/mysqld_safe--skip-grant-tables
-----Change Password, terminal input (progressive input, must, "* * *" for the Set password):
Mysql-u rootupdate mysql.user SET authentication_string=password (' * * * * * ') WHERE user= ' root '; FLUSH privileges;\q
5, after the completion of configuration verification, in the terminal input:
Mysql-u root-p
----Prompt for password, enter MySQL instructions successfully!
Mysql>
6. mysql service startup and shutdown can be operated in System Preferences, the Terminal command is as follows:
$ sudo/usr/local/mysql/support-files/mysql.server start$ sudo/usr/local/mysql/support-files/mysql.server Stop
Install and configure MySQL under Mac