Redis-cli with password

I am using redis and trying to open CLI of redis using this:

$redis-cli -h 127.0.0.1 -p 6379 -a mysupersecretpassword

and getting and error :

(error) NOAUTH Authentication required

why so ?


Solution 1:

My solution is put the password in single quotes like:

$redis-cli -h 127.0.0.1 -p 6379 -a 'thisizmy!PASS' 

Solution 2:

If you have a '$' in your password then it won't work. So set the password without the "$".

Solution 3:

If you have '$' in your password, make sure to enclose the password with single quotes. Then it will work.