Redis-cli not connecting

I have a redis-server instance running, everything works fine if I try to connect to it via code e.g python. The problem is, redis-cli tool doesn't connect. Here's what I get when I run redis-cli:

Could not connect to Redis at 127.0.0.1:6379: �
not connected>
Could not connect to Redis at 127.0.0.1:6379: (
not connected>

Looking at the response, it's adding some characters after the port, in this case : � and : (

What could be the problem here? I've also tried redis-cli -h 127.0.0.1 -p 6379 but to no avail.

Note: Redis server is working fine.

4

1 Answer

Have you verified redis-server service is actually running on localhost and listening on port 6379? Double check the service and port. Those extra characters are strange, but that's where the error message should be for the reason you could not connect. See my error below:

Could not connect to Redis at 127.0.0.1:6379: Connection refuse* 

In my case, redis-server wasn't actually running, and trying to start it via

service redis-server start

command generated errors in /var/log/redis/redis-server.log

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like