Redis入门到入土教程_2 远程连接redis
文章目录
- Redis 教程
- 去除保护模式
- 1.1 注释 bind 127.0.0.1
- 1.2 关闭保护模式
- 1.3 设置redis 登录密码
- 1.4 设置后台自动启动
- 1.5 开放防火墙
- 登录
- 2.1 启动服务
- 2.2 远程连接
- 2.3 输入密码
- 2.4 测试
Redis 教程
1. 去除保护模式
1.1 注释 bind 127.0.0.1
打开redis.config
# bind 127.0.0.1
或者变成
bind 0.0.0.0
允许所有的人来进行访问
1.2 关闭保护模式
protected-mode no
关掉 自身的保护模式
1.3 设置redis 登录密码
requirepass 123
1.4 设置后台自动启动
daemonize yes
1.5 开放防火墙 ⭐️
firewall-cmd --zone=public --add-port=6379/tcp --permanent
firewall-cmd --reload
2. 登录
2.1 启动服务
redis-server /usr/local/redis/etc/redis.conf
根据需要更换路径
2.2 远程连接
redis-cli -p 6379
2.3 输入密码
auth 你的密码
2.4 测试
ping
还没有评论,来说两句吧...