摘要: 1、安装指定的包: pip install redis 2、连接redis并实例化 from redis import Redis xtredis = Redis(host='115.113.105.75',port=6379) 如果连接有设置密码的redis则使用如下方式: from redis 阅读全文
posted @ 2020-01-28 11:56 xsan 阅读(288) 评论(0) 推荐(0) 编辑
摘要: 1、在redis.conf 文件中找到 “#requirepass password”这一行,将其从注释释放(删除其前面的“#”),将password改为要设置的密码。 如 :requirepass 123456,则表示要将redis密码设为123456 2、重启redis,并指定使用的配置文件。 阅读全文
posted @ 2020-01-28 11:47 xsan 阅读(268) 评论(0) 推荐(0) 编辑
摘要: 1、修改redis.conf文件,在bind 127.0.0.1 后面添加本机地址(若为阿里云服务器,请填写内网IP,不要写外网IP) 2、查看防火墙是否开放6379端口: firewall-cmd --zone=public --list-ports 如果结果中有 6379/TCP则直接跳至第4步 阅读全文
posted @ 2020-01-28 11:36 xsan 阅读(2256) 评论(0) 推荐(0) 编辑