Redis 连接到 127.0.0.1:6379 失败 - 连接 ECONNREFUSED [英] Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
本文介绍了Redis 连接到 127.0.0.1:6379 失败 - 连接 ECONNREFUSED的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我通过 expressjs 使用 node.js
我尝试将帐户存储到会话中.所以,我尝试测试在 expressjs
I working with node.js by expressjs
I try to store an account to session. So, i try to test to use session with code in expressjs
var RedisStore = require('connect-redis')(express);
app.use(express.bodyParser());
app.use(express.cookieParser());
app.use(express.session({ secret: "keyboard cat", store: new RedisStore }));
但我收到错误Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
.
请帮我解决这个问题
but I got error Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
.
Please help me resolve this problem
推荐答案
安装redis后,从终端输入:
After you install redis, type from terminal:
redis-server
然后你就会运行 redis
and you'll have redis running
这篇关于Redis 连接到 127.0.0.1:6379 失败 - 连接 ECONNREFUSED的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文