1
0
md/ubuntu-redis.md

70 lines
753 B
Markdown
Raw Permalink Normal View History

2025-01-10 11:12:19 +08:00
下载解压
```
cd /usr/local
```
```
wget https://download.redis.io/releases/redis-6.2.14.tar.gz
```
```
tar -zvxf redis-6.2.14.tar.gz
```
```
cd /usr/local/redis-6.2.14
```
编译安装
```
make
```
```
make install
```
```
mkdir /etc/redis
```
```
cp /usr/local/redis-6.2.14/redis.conf /etc/redis
```
修改配置项
```
vim /etc/redis/redis.conf
```
后台运行
```
daemonize 改成 yes
```
启动
```
cd /usr/local/redis-6.2.14/bin
```
```
redis-server /etc/redis/redis.conf
```
进入控制台
```
cd /usr/local/redis-6.2.14/bin
```
```
redis-cli
```
设置访问密码(可选)把`123456`替换成你想设置的密码
```
config set requirepass "123456"
```
登录
```
auth "123456"
```
验证密码
```
config get requirepass
```