package com.example.springdataredis;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.RedisTemplate;
@SpringBootTest
public class RedisTest {
@Autowired
private RedisTemplate redisTemplate;
@Test
public void testString(){
redisTemplate.opsForValue().set("name","sam");
Object name=redisTemplate.opsForValue().get("name");
System.out.println(name);
}
}
执行上端代码
以redis-server redis.windows.conf 方式启动redis服务器报错如下

以redis-server启动服务器正常运行、为什么