一. 登錄阿里云服務(wù)器并安裝redis
Download, extract and compile Redis with: $ wget https://download.redis.io/releases/redis-6.2.1.tar.gz$ tar xzf redis-6.2.1.tar.gz$ cd redis-6.2.1$ make The binaries that are now compiled are available in the src directory. Run Redis with: $ src/redis-server
或者執(zhí)行,nohup src/redis-server & 來(lái)后臺(tái)運(yùn)行
You can interact with Redis using the built-in client: $ src/redis-cliredis> set foo barOKredis> get foo"bar"
二. 在安全組規(guī)則里面添加訪問(wèn)規(guī)則,開啟6379端口。
三. 連接redis的時(shí)候,出現(xiàn) redis.exceptions.ResponseError: DENIED Redis is running in protected mode because protected mode is enabled 錯(cuò)誤
這時(shí),設(shè)置protected-mode no即可
最后用 Another Redis DeskTop Manager輸入阿里云主機(jī)和端口,即可連接redis數(shù)據(jù)庫(kù)。