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時,客戶端打不開,緣由是須要先開啓服務端,這須要先配置——redis

1.找到redis.conf 並修改 daemonize no 爲 daemonize yes ,這樣就能夠默認啓動就後臺運行server

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

2.開啓客戶端要確保服務端啓動blog

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

3.啓動客戶端不成功要退出再進行下一步io

如今就能夠正常訪問了class

[root@rongle /]# redis-server /etc/redis.conf 
[root@rongle /]# redis-cli 
redis 127.0.0.1:6379>
相關文章
相關標籤/搜索