命令行进入Redis的文件夹:
D:\Redis-x64-3.2.100>redis-cli.exe
查看是否设置了密码:
127.0.0.1:6379> auth root
(error) ERR Client sent AUTH, but no password is set
说明没有设置密码,执行命令:
127.0.0.1:6379> config set requirepass root
OK
出现OK说明设置成功
redis 127.0.0.1:6379>auth root
redis 127.0.0.1:6379> config set requirepass “123456”
OK
redis 127.0.0.1:6379> auth 123456
Ok