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

[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>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM