如何给windows版本redis设置密码

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,就可以了。

猜你喜欢

转载自blog.csdn.net/qq_46112274/article/details/123269709