Redis connection time reports DENIED Redis is running in protected mode error

Today, when I used the Springboot project to create a redis client, an error was reported: DENIED Redis is running in protected mode

The reason for the error: when linking to redis, only the local localhost (127.0.0.1) can be used to link, but the network ip (192.168.118.128) link cannot be used.

Solution:

  • Open the configuration file redis.conf (open file command: vi redis.conf)

# bind 127.0.0.1 // The default local connection, you can connect to the network after commenting it out

  • Redis does not run as a daemon by default, it can be modified through this configuration item, use yes to enable the daemon and set it to no

daemonize no

  • Protected mode (the default is yes, the protected mode is turned on, because there is no password set, this is the safe mode of redis, we set it to no)

protected-mode no

The reason why I reported this error is that the configuration file was not taken with the startup

Start the redis command correctly: ./redis-server redis.conf      (redis.conf is your directory address)

Guess you like

Origin blog.csdn.net/qq_43037478/article/details/111411167