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

[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 nodaemonize yes ,这样就可以默认启动就后台运行

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

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

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

现在就可以正常访问了

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

相关文章:

  • 2022-01-12
  • 2022-12-23
  • 2022-12-23
  • 2022-01-30
  • 2021-08-10
  • 2022-12-23
  • 2021-07-20
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-14
  • 2021-11-12
  • 2022-12-23
  • 2021-05-18
相关资源
相似解决方案