Unable to connect to Redis; nested exception is io.lettuce.core.RedisConnectionException: Unable to

springboot配置redis连接出现错误:

Unable to connect to Redis; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to localhost:6379

之前一直没发现application.yml有什么书写错误问题,后面重新打开idea,发现application.yml的redis配置这块出现了一些\u00A0

,这是全角空格的16进制ASCII编码。建议application.yml的书写,不要用复制粘贴的,我之前是从EditPlus复制过来的,可能编码不一样导致的。

解决方法:手动把\u00A0去掉,重新编译启动就可以了

Unable to connect to Redis; nested exception is io.lettuce.core.RedisConnectionException: Unable to