通过brew安装

  1. 通过brew安装
  2. appstore安装Xcode
  3. /usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
  4. 如果很慢,尝试如下方式
  5. curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install
  6. 修改brew_install,BREW_REPO = “https://github.com/Homebrew/brew".freeze改为BREW_REPO = “https://mirrors.ustc.edu.cn/brew.git".freeze
  7. ruby brew_install
  8. 此时脚本会停在 :Tapping homebrew/core Cloning into
  9. git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core —depth=1
  10. cd $(brew —repo)
  11. git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
  12. cd “$(brew —repo)/Library/Taps/homebrew/homebrew-core”
  13. git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
  14. brew update
  15. brew install mysql

忘记root密码

https://www.jianshu.com/p/6a70affeb5b1