The default configuration of Redis does not require password authentication, which means that as long as the host and port of the connected Redis server are correct, you can connect and use it. This will cause certain security problems, so you need to enable the Redis authentication password to increase the security of the Redis server.
Recommended: "Redis Video Tutorial"
We can modify the following configuration in redis.conf and add authentication.
(Uncomment the following configuration, then modify the password specified by foobared for you, and restart redis-server to take effect.)
# requirepass foobared
Then, when the client connects, enter the auth password. Certifiable.
The above is the detailed content of Do I need a password to connect to redis?. For more information, please follow other related articles on the PHP Chinese website!