Redis – Connection Auth Command

  • Post author:
  • Post category:Redis
  • Post comments:3 Comments

Redis AUTH command is used to authenticate to the server with the given password. If the password matches the password in the configuration file, the server replies with the OK status code and starts accepting commands. Otherwise, an error is returned and the clients needs to try a new password.

Return Value

String reply.

Syntax

Following is the basic syntax of Redis AUTH command.

redis 127.0.0.1:6379> AUTH PASSWORD

Example

redis 127.0.0.1:6379> AUTH PASSWORD 
(error) ERR Client sent AUTH, but no password is set 
redis 127.0.0.1:6379> CONFIG SET requirepass "mypass" 
OK 
redis 127.0.0.1:6379> AUTH mypass 
Ok 

This Post Has 3 Comments

Leave a Reply