1、找到配置文件redis.windows.conf
如下图所示,这是redis免安装版的目录。打开redis.windows.conf文件。

2、修改配置
找到requirePass 设置密码。

requirepass yourPassword


3、保存配置,通过命令启动redis服务

D:\Program Files\Redis-x64-3.2.100>  redis-server.exe  redis.windows.conf

4、本机reids客户端工具连接redis,当没有输入密码时,我们发现无法连接redis,说明redis密码设置成功。

5、如果启动报错

#Warning: no config file specified, using the default config. In order to specify a config file use redis-server.exe /path/to/redis.conf

意思是没有使用默认的conf文件

解决办法:在命令行中执行redis-server.exe redis.windows.conf,就可以了。

更多推荐

如何给windows版本redis设置密码