Redis Desktop Manager
错误提示:Can not connect service xxx.Error:Redis Server require password or password invailid.
该版本Redis需要账户名+密码,在此之前可以通过telnet测试端口是否能够连接正常等,排除其他问题。
使用该工具连接时候,会显示密码错误,正确的参数填写格式如下:
SpringBoot集成Redis6.2.6
1、POM.xml配置
SpringBoot的版本需要高些,否则没有username这项配置
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.5</version>
<relativePath/>
</parent>
<!-- Redis依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
</dependency>
2、application.properties
需要携带spring.redis.username=bidding
spring.redis.host=IP地址
spring.redis.port=端口号
spring.redis.username=用户名!
spring.redis.password=密码
3、Test
@SpringBootTest(classes = MyApplication.class)
public class RedisTest {
@Autowired
private RedisTemplate redisTemplate;
@Test
public void testTemplate(){
redisTemplate.opsForValue().set("k1","v1");
System.out.println(redisTemplate.opsForValue().get("k1"));
}
}
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。