brew install mysql
Install MySQL. Log as follows:==> Installing dependencies for Mysql:openssl
==> installing MySQL Dependency:openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2l.sierra.bottle.tar.gz
######################################################################## 100%
==> Pouring openssl-1.0.2l.sierra.bottle.tar.gz
==> Using the Sandbox
==> Caveats
A CA file has been bootstrapped using certificates from the Systemroots
Keychain. To add additional certificates (e.g. the certificates added in
The System keychain), place. Pem files in
/usr/local/etc/openssl/certs
and run
/usr/local/opt/openssl/bin/c_rehash
This formula is keg-only, which means it wasn't symlinked into/usr/local,
Because Apple have deprecated use of the OpenSSL in favor of its own TLS and crypto libraries.
If you need to the software first in your PATH run:
echo ' Export path= '/usr/local/opt/openssl/bin: $PATH ' >> ~/.bash_profile
For compilers-to-find this software-need to set:
Ldflags:-l/usr/local/opt/openssl/lib
Cppflags:-i/usr/local/opt/openssl/include
==> Summary
?? /usr/local/cellar/openssl/1.0.2l:1,709 files, 12.2MB
==> installing MySQL
==> Downloading https://homebrew.bintray.com/bottles/mysql-5.7.18_1.sierra.bottle.tar.gz
######################################################################## 100%
==> Pouring mysql-5.7.18_1.sierra.bottle.tar.gz
==>/usr/local/cellar/mysql/5.7.18_1/bin/mysqld--initialize-insecure--user=chenxu--basedir=/usr/local/Cellar /mysql/5.7.18_1--DATADIR=/USR/LOCAL/VAR/MYSQ
==> Caveats
We ' ve installed your MySQL database without a root password. To secure it run:
Mysql_secure_installation
MySQL is configured to only allow connections from localhost by default
To connect run:
Mysql-uroot
To has launchd start MySQL now and restart at login:
Brew Services start MySQL
Or, if you don ' t want/need a background service can just run:
Mysql.server start
==> Summary
?? /usr/local/cellar/mysql/5.7.18_1:321 files, 232.9MB