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

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时,客户端打不开,缘由是须要先开启服务端,这须要先配置——redis

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

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

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

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

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

如今就能够正常访问了blog

1
2
3
[root@rongle /]# redis-server /etc/redis.conf
[root@rongle /]# redis-cli
redis 127.0.0.1:6379>
相关文章
相关标签/搜索