当前位置:网站首页>Linux安装redis数据库
Linux安装redis数据库
2022-08-11 00:39:00 【最菜的黑客】
1.第一步下载redis数据库
cd /usr/local
mkdir Redis
cd /usr/local/Redis
wget https://download.redis.io/releases/redis-6.2.7.tar.gz
2 解压
tar -zxvf redis-6.2.7.tar.gz
3 检查安装环境,需要c语言支持
gcc --version
我的linux已经自带有了c语言环境,如果没有,请自行安装,命令为
yum install gcc
如果没有yum命令,请先安装yum源,没有yum命令会报错
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
安装yum命令参考
CentOS6使用yum命令出错_最菜的黑客的博客-CSDN博客_centos6 yum报错
4 编译
cd /usr/local/Redis/redis-6.2.7
make
出现下图表示成功
如果出现报错
——Jemalloc/jemalloc.h:没有那个文件
(1)检查下gcc环境 gcc --version
(2)如果gcc环境没问题,执行命令make distclean
5安装redis
make install
安装的文件在 /usr/local/bin 下
cd /usr/local/bin
ls
6 启动redis
(1)前台启动redis,窗口关闭后不能运行(不推荐)
redis-server
(2)修改配置文件,注意,配置文件在第二步的解压目录中,这里是/usr/local/Redis/redis-6.2.7 (推荐)
cd /usr/local/Redis/redis-6.2.7
vi redis.conf
按两次q进行查询,查询内容为 /daemonize
按insert进行编辑
把daemonize no改为daemonize yes
版本问题,有些版本没有daemonize,没有就手动加入
修改完成,记得保存,按一下Esc,输入:wq! (冒号也要)
启动命令:redis-server redis.conf文件的全路径,如
redis-server /usr/local/Redis/redis-6.2.7/redis.conf
如果没报错就说明 redis成功运行,查看redis是否成功运行的命令为:
ps -ef | grep redis
7连接redis数据库
redis-cli
边栏推荐
猜你喜欢
C# using timer
[Excel知识技能] 将数值格式数字转换为文本格式
[21 Days Learning Challenge] Half Insertion Sort
Based on the SSM to reach the phone sales mall system
Elastic scaling of construction resources
关于编程本质那些事
J9 Digital Theory: DAO governance is more like an ecological process: governance is native to the network and continues to evolve
Kunpeng compilation and debugging and basic knowledge of native development tools
ADC和DAC记录
14. Thymeleaf
随机推荐
虚拟电厂可视化大屏,深挖痛点精准减碳
复制带随机指针的链表——LeetCode
分布式.性能优化
YOLOv5的Tricks | 【Trick11】在线模型训练可视化工具wandb(Weights & Biases)
微信小程序强制更新版本
EPro-PnP: Generalized End-to-End Probabilistic Perspective-n-Points for Monocular Object Pose Est...
如何破坏Excel文件,让其显示文件已损坏方法
[Data Visualization] Chart Design Principles
【考虫 六级英语】语法课笔记
Web-based meal ordering system in epidemic quarantine area
Difference Between Image Recognition and Semantic Segmentation
[21天学习挑战赛——内核笔记](五)——devmem读写寄存器调试
Ali P7 bask in January payroll: hard to fill the, really sweet...
Analysis of LENS CRA and SENSOR CRA Matching Problems
LeetCode_优先级队列_692.前K个高频单词
Only lazy and hungry. You still don't understand the singleton pattern!
分库分表ShardingSphere-JDBC笔记整理
HW-蓝队工作流程(1)
【C语言】探索数据的存储(整形篇)
二维数组实战项目--------《扫雷游戏》