我正在使用 node_redis 模块,但无法成功确定 redis 的密码。
这是我的代码:
var redis = require("redis"),
client = redis.createClient(6379, "localhost");
client.auth("password", function (err) { if (err) throw err; });
每当我在命令行中运行此文件时,我都会收到以下消息:“Redis 不需要密码,但提供了密码。”
即使我尝试更改计算机的 redis 安装中的 redis.conf 文件,我仍然会遇到同样的错误:
requirepass password
请阐明这个问题。
最佳答案
当你启动redis服务器时使用这个命令: redis服务器/path/to/redis.conf
这样它将使用在 redis.conf 中指定的密码验证连接
关于node.js - 如何在 node.js 中使用 redis 进行身份验证?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29465081/