基础安装
brew install mysql@5.7 #其中@5.7指定了 5.7 版本,不写默认为最新版本
brew link --force mysql@5.7 #添加链接
brew services start mysql@5.7 #启动 mysql5.7
配置
mysql_secure_installation #进行安装设置
# 第一步设置:是否开启密码校验
VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?
Press y|Y for Yes, any other key for No: n
# 第二步设置:删除匿名用户
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
# 第三步设置:禁止root远程登录
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : n
# 第四步设置:删除测试数据库
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
# 第五步设置:重新加载数据表权限
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
安装 Redis
基础安装
brew install redis
参数都是在配置文件中,其路径为:
/usr/local/etc/redis.conf
修改参数后,可以通过 如下命令,进行启动关闭停止
brew services start redis #启动
brew services stop redis #关闭
brew services restart redis #重启
删除的方法
brew uninstall redis
rm ~/Library/LaunchAgents/homebrew.mxcl.redis.plist