redis安装(Windows+Linux)

redis安装

文章目录

  • redis安装
  • 一. windows下安装
  • 二.Linux环境下安装

一. windows下安装

下载地址(github):

https://github.com/tporadowski/redis/releases (强烈推荐)

https://github.com/MicrosoftArchive/redis/releases

选择安装包

redis安装(Windows+Linux)_第1张图片

下载完成后根据提示进行安装即可(这里建议安装位置选择到C盘以外的其他盘),还有一点是记得勾选这里的Add the Redis installation folder to the PATH environment variable.(这里方便安装完成后可以直接在cmd中使用)

redis安装(Windows+Linux)_第2张图片

剩下的默认点next即可

安装完成后打开cmd输入redis-cli即可连接到redis客户端

redis安装(Windows+Linux)_第3张图片

在命令中输入ping命令来检测redis服务器与redis客户端的连通性,返回PONG则说明连接成功了。

至此在windows环境下redis安装成功。

二.Linux环境下安装

在这里系统使用的是Ubuntu20.04,连接工具使用的是xshell7

使用apt安装

apt install redis -y

⽀持远程连接

修改 /etc/redis/redis.conf

修改 bind 127.0.0.1 bind 0.0.0.0

修改 protected-mode yesprotected-mode no

控制Redis启动
启动Redis服务

service redis-server start

停止Redis服务

service redis-server stop

重启Redis服务

service redis-server restart

连接Redis客户端

root@VM-8-6-ubuntu:~# redis-cli
127.0.0.1:6379> ping
PONG
127.0.0.1:6379>

6-ubuntu:~# redis-cli
127.0.0.1:6379> ping
PONG
127.0.0.1:6379>


以上就是Redis在windows和linux环境下的安装教程,安装过程中如有问题欢迎到评论区留言

你可能感兴趣的:(Redis,笔记,redis,linux,数据库)