Redis 配置远程连接

修改 Redis 的配置文件 /etc/redis.conf

# bind 127.0.0.1 -::1
bind 0.0.0.0 # 绑定 ip,0.0.0.0 表示不绑定
protected-mode yes # 开启保护模式
requirepass 123456 # 设置密码

连接即可

# h - host, p - port, a - auth
redis-cli -h <ip地址> -p <端口6379> -a <密码>
# 或
redis-cli -h <ip地址> -p <端口6379> # 推荐
auth <密码>
posted @ 2022-07-16 16:15  村上春树的叶子  阅读(20)  评论(0编辑  收藏  举报