redis记录三坑
一,在安装Redis时,按步骤安装结果在启动时却提示找不到redis.conf配置文件,试过更改redis.conf的路径发现都不行,
之后干脆放在Redis的bin目录下跟redis-server在同一目录下,在启动时直接输入
[root@zzj001 bin]# ./redis-server redis.conf
便可以,输入简捷又解决问题。
二,当用IDEA连接Redis时,报错:
DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified,
按照网上在redis.conf设置protected-mode no 关闭保护模式也无效,
后来输入命令:
127.0.0.1:6379> config set requirepass 123456
OK
127.0.0.1:6379>
然后在application.properties添加配置:
spring.redis.password=123456
问题解决。
三,当你下次用密码登录时:
[root@zzj001 bin]# redis-cli -h 127.0.0.1 -p 6379 -a 123456
会出现以下提示:
Warning: Using a password with '-a' option on the command line interface may not be safe.
此时已经登录成功,但当你输入ping命令时,会提示错误:
(error) MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on dis
k. Commands that may modify the data set are disabled, because this instance is configured to report errorsduring writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.
此时不用慌,我们接着输入以下命令:
config set stop-writes-on-bgsave-error no
就可以看到提示“”ok“”。
再ping的时候便提示pong,问题解决。