当前位置:网站首页>Redis在Windows以及Linux系统下的安装
Redis在Windows以及Linux系统下的安装
2022-07-03 15:32:00 【我没得冰阔落.】
一、redis安装
1、Windows系统安装
- 安装包下载,链接:
https://pan.baidu.com/s/13A1mDApAct31bYyRXOfaNg?pwd=l7kq
提取码:l7kq
- 解压
2、Linux系统安装
- 安装包下载
https://download.redis.io/releases/
,或者我百度网盘也有:
链接:https://pan.baidu.com/s/1Z0LGJewCnVQidZLbTixPzQ?pwd=qxlv
提取码:qxlv
- 将安装包上传到Linux系统, 我用的是
finalshell
上传 - 解压安装包
tar -zxvf redis-4.0.0.tar.gz -C /usr/local
- 安装编译依赖
yum install gcc-c++
- 编译redis,进入解压后的redis目录下面,执行命令编译:
make
- 进入它的src目录,执行:
make install
二、启动与连接
1、Windows系统
- 启动:点击redis-server.exe,或者命令行进入到redis目录下,执行redis-server
- 连接:点击redis-cli.exe,或者命令行进入redis目录下,执行redis-cli
2、Linux系统
- 启动服务:进到redis的src目录下,执行命令:
./redis-server
。安装后服务默认是在前台运行,配置后台运行在redis和src同级目录有一个redis.config
文件,把里面的daemonize
参数改成yes - 连接:进到redis的src目录下,执行命令:
./redis-cli
三、修改权限
1、Windows系统
- 修改密码:打开
redis.windows.config
文件,找到requirepass foobared
,将它的注释结掉,将后面的foobared替换成你的密码。或者连接redis,输入命令:config set requirepass 1234
,出现OK就修改成功了,以后连接redis时输入命令:redis-cli -a 密码
。 - 开放连接权限:在
redis.windows.config
文件中找到bind 127.0.0.1
,将它注释掉就可以了。
2、Linux系统
- 修改密码:在
redis.conf
文件来面找到requirepass foobared
,将它的注释结掉,将后面的foobared替换成你的密码。先关掉所有服务再重启服务,在通过命令:redis-cli -a 密码
连接 - 开放连接权限:在配置文件中找到:
bind 127.0.0.1
,将它注释掉,因为不注释代表默认本机连接。重启服务,如果还是连不上可能是端口没有开放,开放6379端口:firewall-cmd --zone=public --add-port=6379/tcp --permanent
,刷新:firewall-cmd --reload
,可以通过:firewall-cmd --zone=public --list-ports
查看端口是否开放成功,现在其它服务器就可以连接这个redis了。
边栏推荐
- 【日常训练】395. 至少有 K 个重复字符的最长子串
- Kubernetes - yaml file interpretation
- WinDbg分析dump文件
- Can‘t connect to MySQL server on ‘localhost‘
- Puppet自动化运维排错案例
- Using TCL (tool command language) to manage Tornado (for VxWorks) can start the project
- The difference between mutually exclusive objects and critical areas
- Detailed explanation of string function and string function with unlimited length
- Construction of operation and maintenance system
- 互斥对象与临界区的区别
猜你喜欢
Wechat payment -jsapi: code implementation (payment asynchronous callback, Chinese parameter solution)
Halcon与Winform学习第二节
MySQL reports an error: [error] mysqld: file '/ mysql-bin. 010228‘ not found (Errcode: 2 “No such file or directory“)
CString getbuffer and releasebuffer instructions
Construction of operation and maintenance system
Jvm-06-execution engine
GCC cannot find the library file after specifying the link library path
Kubernetes advanced training camp pod Foundation
Popular understanding of ovo and ovr
《微服务设计》读书笔记(下)
随机推荐
Digital image processing -- popular understanding of corrosion and expansion
leetcode_ Power of Four
Baidu AI Cloud helps Shizuishan upgrade the smart health care model of "Internet + elderly care services"
视觉上位系统设计开发(halcon-winform)
Tensorflow realizes verification code recognition (II)
Jvm-08-garbage collector
do{}while()的妙用
视觉上位系统设计开发(halcon-winform)-1.流程节点设计
软件逆向破解入门系列(1)—xdbg32/64的常见配置及功能窗口
视觉上位系统设计开发(halcon-winform)-2.全局变量设计
视觉上位系统设计开发(halcon-winform)-4.通信管理
What are the composite types of Blackhorse Clickhouse, an OLAP database recognized in the industry
视觉上位系统设计开发(halcon-winform)-3.图像控件
qt使用QZxing生成二维码
Jvm-02-class loading subsystem
PyTorch crop images differentiablly
Detailed comments on MapReduce instance code on the official website
Introduction, use and principle of synchronized
百度智能云助力石嘴山市升级“互联网+养老服务”智慧康养新模式
The state does not change after the assignment of El switch