一. 登录阿里云服务器并安装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-cliredis> set foo barOKredis> 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数据库。