preface

This article will introduce the basic installation and configuration of Redis, and give the installation methods for different platforms (Windows, Linux, MacOS). At the same time, the Redis version file used in this article can be downloaded from the web disk link at the end of the article or through the official website link.

Windows

On Windows, I installed Redis-X64-3.0.504 and installed the compressed package (see the resource link of the compressed package at the end of the article). First, I decompressed the compressed package to the specified folder (you can choose other locations here, system disk is not recommended generally, there may be permission problems, because I used the VIRTUAL machine environment test, So it’s casual) :

Then create a new my.conf file in this directory with the following contents:

Bind 0.0.0.0 port 6379 requirepass 123456Copy the code

To facilitate future startup and ensure that the running window is not reserved when the Redis service is started, you can create a new redis. Bat script in the directory with the following contents:

@echo off
if "%1" == "h" goto begin
mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit
:begin
redis-server.exe my.conf
Copy the code

Then double-click the redis. Bat file (you can also create the corresponding shortcut), you can see a flash of black window, and then we can use redis Desktop Manager(hereinafter referred to as RDM) on the local machine to test the connection, first look at the IP address:

Then connect the test:

Linux

On Linux, I installed Redis-6.2.4 and installed it as a zipped package (see the zipped package link at the end of this article). First, I unzipped the zipped package to the specified folder:

Then compile:

cdRedis - 6.2.4 / makeCopy the code

Go to SRC and create a new my.conf file:

cd src
vim my.conf
Copy the code

As follows:

Bind 0.0.0.0 protected-mode no port 6379 daemonize yes requirepass 123456Copy the code

Then save and exit and start Redis by typing the following command in the current directory:

./redis-server my.conf
Copy the code

Then run the following command to open port 6379:

systemctl start firewalld
firewall-cmd --zone=public --add-port=6379/tcp --permanent
firewall-cmd --reload
Copy the code

Then look at the local IP:

Then use RDM to test the connection:

MacOS

The same redis-6.2.4 is installed under MacOS and Linux. The overall steps are similar. First, unpack:

Then compile:

cdRedis - 6.2.4 / makeCopy the code

Go to SRC and create a new my.conf file:

cd src
vim my.conf
Copy the code

As follows:

Bind 0.0.0.0 protected-mode no port 6379 daemonize yes requirepass 123456Copy the code

Then save and exit and start Redis by typing the following command in the current directory:

./redis-server my.conf
Copy the code

Then look at the local IP:

Then use RDM to test the connection:

Links to resources

Link: pan.baidu.com/s/1eO7vqOpi… Extraction code: 6FOX

Windows official website link: github.com/MicrosoftAr…

Linux & MAC website links: download. Redis. IO/releases/re…