I have a Redis server. When I try the ping
command or any other command using redis-cli ping
I get an error message saying:
(error) ERR operation not permitted
typing only redis-cli
takes me to the prompt:
redis 127.0.0.1:6379>
after this any redis command again gives the same error. I have no idea what the issue could be. Any help is appreciated.
The best way to know the error is to start redis-server.exe from command prompt. Locate your redis installation (usually C:\Program Files\Redis ) and open the command prompt with that directory as current directory. then Run redis-server.exe by typing it on the prompt.
Redis has a few blocking commands among the built-in set of commands. One of the most used is BLPOP (or the symmetric BRPOP ) which blocks waiting for elements arriving in a list. The interesting fact about blocking commands is that they do not block the whole server, but just the client calling them.
If the Redis server becomes unavailable you must flush it (clean out the entries) before making it available again. Otherwise there's a chance that you might start retrieving cache entries that have incorrect data because of updates that occurred in the meantime.
To start Redis client, open the terminal and type the command redis-cli. This will connect to your local server and now you can run any command. In the above example, we connect to Redis server running on the local machine and execute a command PING, that checks whether the server is running or not.
In your redis.conf
file - is there a requirepass
field that is set (and not commented out with #
) - if so, you need to authenticate first like this:
AUTH Pwd (replace Pwd with actual password phrase)
Once authenticated, you can issue new commands.
requirepass
option may be enabled in your configuration file redis.conf
by default
Pass the authenticated with -a
argument after redis-cli
command:
$ redis-cli -a YourPass
exec auth
command after redis prompt:
> auth YourPass
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With