解决方法
1、修改redis服务器的配置文件
vi redis.conf

注释以下绑定的主机地址

# bind 127.0.0.1

或
vim  redis.conf

bind  0.0.0.0

protected-mode   no

2、修改redis服务器的参数配置
修改redis的守护进程为no,不启用

127.0.0.1:6379> config  set   daemonize  "no"

OK

修改redis的保护模式为no,不启用

127.0.0.1:6379> config   set   protected-mode"no"

OK

或者

config set requirepass 123 ->123是密码

注意:开启 6379端口
 

3、远程连接
$ redis-cli -h 138.138.138.138  -p  6379 

redis>ping

PONG

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-09
  • 2021-09-09
  • 2021-04-04
猜你喜欢
  • 2022-12-23
  • 2021-05-12
  • 2021-12-12
  • 2021-12-29
相关资源
相似解决方案