3
我正在开发一个已经安装了redis的mac。默认情况下它不具有redis.conf
这样的默认设置是,当我$ redis-server
Redis的“操作不允许”
# Warning: no config file specified, using the default config. In order to specify a config file use 'redis-server /path/to/redis.conf'
我想使用redis-py
使用并具有下列
import redis
r = redis.Redis('localhost')
r.set('foo','bar')
r.get('foo')
而且得到了以下错误
redis.exceptions.ResponseError: operation not permitted
我也尝试在终端$ redis-cli ping
,但后来我得到以下错误
(error) ERR operation not permitted
我想因为没有redis.conf
默认设置没有密码对不对?不管怎么说,我也试图创建一个redis.conf
$ echo "requirepass foobared" >> redis.conf
$ redis-server redis.conf
然后在另一个窗口
$ redis-cli
$ redis 127.0.0.1:6379> AUTH foobared
(error) ERR invalid password
还修改了python脚本的第二行
r = redis.StrictRedis(host='localhost', port=6379, db=0, password='foobared')
,但后来我
redis.exceptions.ResponseError: invalid password
我能做什么错?谢谢
你试过路过'密码='? – 2013-04-08 15:21:59
@JonClements:是的,对不起,这是一个错字。在问题中修复。有什么建议么? thx – minovsky 2013-04-08 15:28:27
发布你的redis配置 – 2013-04-16 22:02:49