網站首頁 編程語言 正文
1.Redis下載
https://download.redis.io/releases/
2.Redis安裝包上傳到Linux
本文是放在usr/local的文件夾下
3.解壓壓縮包
tar -xzvf redis-6.2.5.tar.gz
4.安裝Redis的依賴環境gcc
yum install gcc-c++
5.進入/usr/local/redis-5.0.0,進項編譯
make
6.進入redis的src目錄,進行安裝
make install
7.啟動redis
./redis-server
8.redis.conf文件修改
后臺進程方式啟動
[root@localhost redis-5.0.0]# vim redis.conf
修改daemonize no 為daemonize yes
9.修改文件后重新在后臺啟動redis
注意:啟動文件在redis-5.0.0的src文件下
[root@localhost redis-5.0.0]# src/redis-server ./redis.conf
1585:C 20 Sep 2022 17:04:49.398 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1585:C 20 Sep 2022 17:04:49.398 # Redis version=5.0.0, bits=64, commit=00000000, modified=0, pid=1585, just started
1585:C 20 Sep 2022 17:04:49.398 # Configuration loaded
[root@localhost redis-5.0.0]# cd src
[root@localhost src]# ./redis-cli
127.0.0.1:6379>
補充:
1)redis是默認端口,以及Redis本身沒有設置密碼,如果需要修改的話,在src/conf文件進行設置
本文僅修改密碼,端口號方法相同
[root@localhost redis-5.0.0]# vim redis.conf
2)殺掉進程
ps -aux|grep redis
kill -9 1586
3)重新啟動
[root@localhost redis-5.0.0]# src/redis-server ./redis.conf
1780:C 20 Sep 2022 17:30:25.853 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1780:C 20 Sep 2022 17:30:25.853 # Redis version=5.0.0, bits=64, commit=00000000, modified=0, pid=1780, just started
1780:C 20 Sep 2022 17:30:25.853 # Configuration loaded
4)密碼修改后確認
[root@localhost redis-5.0.0]# src/redis-cli
127.0.0.1:6379> keys *
(error) NOAUTH Authentication required.
127.0.0.1:6379> auth 123456
OK
127.0.0.1:6379> exit
//確認端口號的 localhost -p 6379
[root@localhost redis-5.0.0]# src/redis-cli -h localhost -p 6379
localhost:6379> keys *
(error) NOAUTH Authentication required.
localhost:6379> auth 123456
OK
原文鏈接:https://blog.csdn.net/weixin_45428910/article/details/126964917
- 上一篇:如何查看Redis的host和port
- 下一篇:文本文件與二進制文件的區別
相關推薦
- 2022-06-01 聊聊.Net,Core配置Nlog.md的問題_實用技巧
- 2022-07-08 C語言完整實現12種排序算法(小結)_C 語言
- 2022-12-30 react中useState改變值不渲染的解決方式_React
- 2022-06-06 微信小程序動態綁定class
- 2022-06-11 golang實現簡單工廠、方法工廠、抽象工廠三種設計模式_Golang
- 2022-09-13 C++中string使用+號與int拼接方式_C 語言
- 2022-08-03 C#記一次http協議multipart/form-data的boundary問題_C#教程
- 2022-02-01 CSS3自定義滾動條樣式
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支