首页 > 其他 > 详细

Redis连接时报错:Could not connect to Redis at 127.0.0.1:6379: Connection refused

时间:2019-08-06 10:49:31      阅读:92      评论:0      收藏:0      [点我收藏+]

Could not connect to Redis at 127.0.0.1:6379: Connection refused

1
2
3
4
5
[root@rongle bin]# redis-cli
Could not connect to Redis at 127.0.0.1:6379: Connection refused
[root@rongle /]# redis-server /etc/redis.conf
[root@rongle /]# redis-cli
redis 127.0.0.1:6379>

在安装好redis扩展 尝试连接redis时,客户端打不开,原因是需要先开启服务端,这需要先配置——

1.找到redis.conf 并修改 daemonize no 为 daemonize yes ,这样就可以默认启动就后台运行

1
[root@rongle conf.d]# vi /etc/redis.conf

2.开启客户端要确保服务端启动

1
[root@rongle /]# redis-server /etc/redis.conf

3.启动客户端不成功要退出再进行下一步

现在就可以正常访问了

1
2
3
[root@rongle /]# redis-server /etc/redis.conf
[root@rongle /]# redis-cli
redis 127.0.0.1:6379>

Redis连接时报错:Could not connect to Redis at 127.0.0.1:6379: Connection refused

原文:https://www.cnblogs.com/niuben/p/11307406.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!