实战 Mac
Brew 安装
安装 Homebrew
https://brew.sh/
1
| /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
配置国内镜像
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git # 清华大学: git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
# 替换homebrew-core.git: cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git # 清华大学: git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
# 替换homebrew-bottles:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile source ~/.bash_profile # 清华大学: echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile source ~/.bash_profile
# 应用生效: brew update
|
确定 brew 健康状况
1 2 3 4
| # 确认brew在正常工作 brew doctor # update更新包 brew
|
Mysql
安装
开启服务
1
| brew services start mysql
|
设置用户名密码
设置简单密码规则
1 2 3 4 5 6 7 8
| mysql -uroot
set global validate_password.policy=0; set global validate_password.length=1;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'example';
|
验证