当前位置:网站首页>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
边栏推荐
- 微信小程序强制更新版本
- Web-based meal ordering system in epidemic quarantine area
- In 22 years, the salary of programmers nationwide in January was released, only to know that there are so many with annual salary of more than 400,000?
- 池化技术有多牛?来,告诉你阿里的Druid为啥如此牛逼!
- Dump文件生成,内容,以及分析
- 使用 BeanUtils 做属性拷贝,性能有点拉胯!
- 【js】获取当前时间的前后n天或前后n个月(时分秒年月日都可)
- 【21天学习挑战赛】折半插入排序
- Shell编程三剑客之sed
- How to build speed, speed up again
猜你喜欢
异常和异常处理机制
二维数组实战项目--------《扫雷游戏》
如何破坏Excel文件,让其显示文件已损坏方法
SAS data processing technology (1)
[Excel knowledge and skills] Convert "false" date to "true" date format
【ASM】字节码操作 ClassWriter COMPUTE_FRAMES 的作用 与 visitMaxs 的关系
sed of the Three Musketeers of Shell Programming
J9 Digital Theory: DAO governance is more like an ecological process: governance is native to the network and continues to evolve
[Data Visualization] Chart Design Principles
Shell编程三剑客之sed
随机推荐
Qt入门(六)——抽奖系统的实现
20张图,全面掌握MVCC原理!
YOLOv5的Tricks | 【Trick10】从PyTorch Hub加载YOLOv5
异常和异常处理机制
使用mysql语句操作数据表(table)
详解JDBC的实现与优化(万字详解)
91.(cesium之家)cesium火箭发射模拟
@Autowired注入RedisCache报错空指针
ADC和DAC记录
分布式.性能优化
从0开始设计JVM ,忘记名词跟上思路一次搞懂
二维数组实战项目--------《扫雷游戏》
LeetCode_优先级队列_692.前K个高频单词
"NIO Cup" 2022 Nioke Summer Multi-School Training Camp 4 ADHK Problem Solving
[Excel knowledge and skills] Convert text numbers to numeric format
微信小程序内部A页面向内嵌H5页面跳转,并且传参
Lens filter---about day and night dual-pass filter
Why do programming languages have the concept of variable types?
池化技术有多牛?来,告诉你阿里的Druid为啥如此牛逼!
EPro-PnP: Generalized End-to-End Probabilistic Perspective-n-Points for Monocular Object Pose Est...