brew install mysql@5.7 // 安裝 brew link --force mysql@5.7 // 連接 brew services start mysql@5.7 // 啓動服務 brew services stop mysql@5.7 //中止 brew services restart mysql@5.7 //重啓
啓動以後,輸入一行命令mysql
mysql_secure_installation
5.7.x對設置的密碼有嚴格的要求,分爲LOW、MEDIUM、STRONG三個等級,對應要求以下:sql
LOW Length >= 8 MEDIUM Length >= 8, numeric, mixed case, and special characters STRONG Length >= 8, numeric, mixed case, special characters and dictionary file
選low便可,輸入8位,我這裏使用12345678 ,其餘一路y確認便可。shell
➜ ~ brew services start mysql@5.7 ==> Successfully started `mysql@5.7` (label: homebrew.mxcl.mysql@5.7)
帳號:root
密碼:12345678
rest