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 no 為 daemonize 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>