1、在yml中添加依赖如下:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
2、
开启cmd 窗口 使用 cd 命令切换目录到 d:\redis 运行:
redis-server.exe redis.windows.conf
另启一个 cmd 窗口,原来的不要关闭,不然就无法访问服务端了 切换目录到 d:\redis 运行:
redis-cli.exe -h 127.0.0.1 -p 6379