網站首頁 編程語言 正文
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
- 下一篇:文本文件與二進制文件的區別
相關推薦
- 2023-03-21 C#實體類轉換的兩種方式小結_C#教程
- 2024-04-02 Springboot 切換Log4j2日志
- 2022-03-24 sublime?text3解決Gosublime無法自動補全代碼的問題_Golang
- 2022-05-25 Inspinia的version 2.4模板使用的谷歌字體加載很慢問題解決
- 2022-05-03 python中的map函數語法詳解_python
- 2022-08-20 PostgreSQL實現按年、月、日、周、時、分、秒的分組統計_PostgreSQL
- 2022-05-12 kotlin ..與 until 區別
- 2022-04-25 ASP.NET?Core中Cookie驗證身份用法詳解_實用技巧
- 最近更新
-
- 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同步修改后的遠程分支