一. 登錄阿里雲伺服器並安裝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
或者執行,nohup src/redis-server & 來後台運行
You can interact with Redis using the built-in client:
$ src/redis-cli
redis> set foo bar
OK
redis> get foo
"bar"
二. 在安全組規則裡面添加訪問規則,開啟6379埠。

三. 連接redis的時候,出現
redis.exceptions.ResponseError: DENIED Redis is running in protected mode because protected mode is enabled 錯誤

這時,設置protected-mode no即可

最後用 Another Redis DeskTop Manager輸入阿里雲主機和埠,即可連接redis資料庫。
原創文章,作者:投稿專員,如若轉載,請註明出處:https://www.506064.com/zh-tw/n/252272.html