在新安装redis的时候需要设置密码,如不设置的话也会会报:Could not get a resource from the pool
。
设置方法:
- 在安装文件中找到redis.conf文件(window是redis.windows.conf)
- 将
#requirepass foobared
注释取掉foobared
改为你的密码。例如:requirepass 123456
- 重启redis
注意: 不建议你用命令的方式设置密码例如:redis 127.0.0.1:6379> config set requirepass test123
,因为这样设置后你电脑重启密码就失效了。