From e0f0403080dc2d5da38c39211e90be9d9ba9054b Mon Sep 17 00:00:00 2001 From: 8ga Date: Fri, 10 Jan 2025 11:12:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20ubuntu-redis.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ubuntu-redis.md | 69 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 ubuntu-redis.md diff --git a/ubuntu-redis.md b/ubuntu-redis.md new file mode 100644 index 0000000..b7d68a8 --- /dev/null +++ b/ubuntu-redis.md @@ -0,0 +1,69 @@ +下载解压 +``` +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 +```