【教程】Redis安装(Windows & macOS)
✨Redis
官方网站:https://redis.io/
Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker. Redis provides data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes, and streams. Redis has built-in replication, Lua scripting, LRU eviction, transactions, and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.
✨Windows
Releases · tporadowski/redis (github.com)
点击进入 Redis for Windows
下载 msi 或者 zip
msi
使用msi安装时
需要勾选 “Add the Redis installation folder to the PATH environment variable.”
将Redis安装文件夹添加到PATH环境变量。
(建议下载zip,msi安装后可能遇到闪退等问题)
请不要直接点击msi安装目录的redis-server.exe
使用命令行方式启动
redis-server
zip
下载后解压
双击 redis-server.exe 即可启动
✨macOS
方式一
进入官网下载
下载 Stable(稳定版)
解压文件
tar zxvf redis-6.2.6.tar.gz
把下载后的 redis-6.2.6.tar.gz 放到 /usr/local/ 下
sudo mv redis-6.2.6 /usr/local/
切换目录
cd /usr/local/redis-6.2.6/
编译
sudo make
提示:Hint: It's a good idea to run 'make test' 😉
那就根据提示运行
sudo make test
提示:\o/ All tests passed without errors!
安装
sudo make install
启动服务
redis-server
方法二
brew安装
brew search redis
安装 redis@4.0
brew install redis@4.0
brew会自动完成编译链接等等
后台启动
brew services start redis@4.0
连接客户端
redis-cli -h 127.0.0.1
非后台启动
/usr/local/opt/redis@4.0/bin/redis-server /usr/local/etc/redis.conf
⭐转载请注明出处
本文作者:双份浓缩馥芮白
原文链接:https://www.cnblogs.com/Flat-White/p/15369836.html
版权所有,如需转载请注明出处