上一篇 下一篇 分享链接 返回 返回顶部

vps服务器中linux使用Redis连接时出现报错

发布人:欢子 发布时间:2026-01-21 15:10 阅读量:9
问题一:-DENIEDRedisisrunninginprotectedmodebecauseprotectedmodeisenabled,nobindaddresswasspecified,noauthenticationpasswordisrequestedtoclients解决:redis-cli-p6688127.0.0.1:6688>//改redis守护进程成no,不在启用127.0.0.1:6688>configsetdaemonize“no”OK//改redis保护模式成no,不在启用127.0.0.1:6688>configsetprotected-mode“no”OK或者是进入redis.conf中对配置文件进行修改(切记使用./redis-server/usr/local/redis-4.0.6/redis.conf启动否则不会生效)问题二:MISCONFRedisisconfiguredtosaveRDBsnapshots,butitiscurrentlynotabletopersistondisk原因是因为强制把redis快照关闭了导致不能持久化解决:127.0.0.1:6688>configsetstop-writes-on-bgsave-errorno或者修改redis.conf配置文件:vi打开redus-server配置文件中的redis.conf文件,使用快捷匹配模式定位到stop-writes-on-bgsave-error所在位置,把yes改为no即可问题三:redisERRinvalidDBindex解决:修改redis.windows.conf配置文件即可#Setthenumberofdatabases.ThedefaultdatabaseisDB0,youcan#selectadifferentoneonaper-connectionbasisusingSELECT#wheredbidisanumberbetween0and‘databases’-1#我这里修改为40了databases40
目录结构
全文