赞
踩
前言:此文章的基础是Mac系统已安装过Homebrew,如果未安装,此处奉上教程链接如下,详细介绍Homebrew的用法
Mac安装和使用Homebrew(mac极简软件包管理工具)
brew search redis
brew install redis@4.0
打开.bash_profile文件:
open -e ~/.bash_profile
将Redis环境变量加入后如下:
使.bash_profile生效:
source ~/.bash_profile
brew services start redis@4.0
brew services list //查看正在运行的服务列表
注意:上述的brew services start 命令没有成功启动Redis服务时可使用下面方法
ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
redis-server /usr/local/etc/redis.conf
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
/usr/local/etc/redis.conf
brew uninstall redis rm ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
redis-cli ping //也可以直接使用 redis-cli -h 127.0.0.1测试是否能连接Redis服务
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。