redis 设置密码

1、在redis.conf 文件中找到 “#requirepass password”这一行,将其从注释释放(删除其前面的“#”),将password改为要设置的密码。

如 :requirepass 123456,则表示要将redis密码设为123456

2、重启redis,并指定使用的配置文件。

/src/redis-server redis.conf

3、在连接时可以不用指定密码,但是操作前要指明身份(即:auth 密码)。

否则会报错:

(error) NOAUTH Authentication required.

原文地址:https://www.cnblogs.com/xshan/p/12237671.html