redis简介
Redis 是完全开源免费的,遵守BSD协议,是一个高性能的key- value数据库。
Homebrew 安装
简介
Homebrew是Mac OS中的包管理器,类似于ubuntu下的apt-get。
1.打开终端,将下面内容粘贴在终端里面,然后回车进行下载,过程中需要输入密码,其他无需任何操作:
/usr/bin/ruby -e"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)
2.Homebrew常用命令:
安装软件:brew install oclint卸载软件:brew uninstall oclint搜索软件:brew search oclint更新软件:brew upgrade oclint查看安装列表 :brewlist更新:brew update
通过Homebrew安装
1、执行 brew install redis

redis.png
2.稍等几分钟,会显示安装完成

F1988960-1E24-46A8-882E-D797298AA14A.png
3.启动redis
可以使用后台服务启动 brew services start redis或者直接启动: redis-server /usr/local/etc/redis.conf

连接Redis
使用 redis-cli 然后在ping 测试

切换数据库
数据库没有名称,默认有16个,通过0-15来标识,连接redis的默认选择第一个数据库

链接:https://www.jianshu.com/p/3ea6954d436f
网友评论