Redis连接到127.0.0.1:6379失败 - 连接ECONNREFUSED [英] Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED

查看:11205
本文介绍了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连接到127.0.0.1:6379失败 - 连接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连接到127.0.0.1:6379失败 - 连接ECONNREFUSED的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆