## 安裝MySQL
```
brew install mysql
```
MySQL開機啟動:
```
ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
```
安裝完成之后開啟MySQL安全機制:
```
/usr/local/opt/mysql/bin/mysql_secure_installation
```
根據終端提示,輸入root密碼,然后依次確認一些安全選項。具體信息可以參考外國友人的這篇文章
```
#查看一下MySQL運行情況
? ~ ps aux | grep mysql
calvin 1695 0.0 0.5 2719864 90908 ?? S 1:38上午 0:00.31 /usr/local/Cellar/mysql/5.6.19/bin/mysqld --basedir=/usr/local/Cellar/mysql/5.6.19 --datadir=/usr/local/var/mysql --plugin-dir=/usr/local/Cellar/mysql/5.6.19/lib/plugin --bind-address=127.0.0.1 --log-error=/usr/local/var/mysql/CalvinsMacBook-Pro.local.err --pid-file=/usr/local/var/mysql/CalvinsMacBook-Pro.local.pid --socket=/tmp/mysql.sock --port=3306
calvin 1323 0.0 0.0 2444628 1020 ?? S 1:38上午 0:00.04 /bin/sh /usr/local/opt/mysql/bin/mysqld_safe --bind-address=127.0.0.1 --datadir=/usr/local/var/mysql
#測試連接MySQL
mysql -uroot -p
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 23
Server version: 5.6.19-log Homebrew
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
```
安裝phpmyadmin
```
brew install phpmyadmin
```