下载
windows https://github.com/MicrosoftArchive/redis/releases
linux https://download.redis.io/releases/
linux修改配置文件:
- redis.conf 中 daemonize no 控制是前台运行还是后台运行
- requirepass 123456 修改是否启用密码
- bind 127.0.0.1 开启则代表只允许本地访问
- protected-mode no 关闭redis的保护模式,如果别的机器要调用的时候需要关闭保护模式
启动 (Win10)
服务端
E:\soft\Redis-x64-3.2.100>redis-server.exe redis.windows.conf _._ _.-``__ ''-._ _.-`` `. `_. ''-._ Redis 3.2.100 (00000000/0) 64 bit .-`` .-```. ```\/ _.,_ ''-._ ( ' , .-` | `, ) Running in standalone mode |`-._`-...-` __...-.``-._|'` _.-'| Port: 6379 | `-._ `._ / _.-' | PID: 22452 `-._ `-._ `-./ _.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | http://redis.io `-._ `-._`-.__.-'_.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | `-._ `-._`-.__.-'_.-' _.-' `-._ `-.__.-' _.-' `-._ _.-' `-.__.-' [22452] 15 May 16:02:56.192 # Server started, Redis version 3.2.100 [22452] 15 May 16:02:56.194 * DB loaded from disk: 0.000 seconds [22452] 15 May 16:02:56.195 * The server is now ready to accept connections on port 6379
客户端连接
E:\soft\Redis-x64-3.2.100>redis-cli.exe 127.0.0.1:6379> keys * 1) "famousTeachersAndHotCourse::selectIndexList" 127.0.0.1:6379> a ==============================================================================================================
如果开启了密码
requirepass 123456
重启服务端
客户端连接