第十八章 Redis的使用

文章目录

  • [1. Redis安装](#1. Redis安装)
  • [2. Redis的使用命令](#2. Redis的使用命令)
  • [3. python使用redis](#3. python使用redis)

1. Redis安装

链接:https://pan.baidu.com/s/1EIGLFjDRxWyy1bU9Hwr_dw?pwd=oloh

提取码:oloh

  1. 添加环境变量

  2. Redis 启动

    在命令行输入:redis-server 命令

  • 设置redis数据库的密码
    取消注释 requirepass foobared
    requirepass + password
  • 带密码连接
    redis-cli -a 123456
  1. 安装可视化工具
    redis-desktop-manager-2019.4.0.exe

直接下一步安装即可

2. Redis的使用命令

https://www.redis.net.cn/tutorial/3516.html

3. python使用redis

python 复制代码
# 安装redis
pip install redis 

数据库的连接

python 复制代码
import redis
redis_pool = redis.ConnectionPool(
    host='localhost',
    port=6379,
    password=None,
    db=0,
    decode_responses=True)

redis_conn = redis.Redis(connection_pool=redis_pool)

操作命令

https://www.cnblogs.com/Black-Hawk/articles/11758783.html

相关推荐
cup113 小时前
[技术复盘] Windows Python 打包实战:Nuitka 环境踩坑总结与 CI 自动化构建全指南
python·ai·环境变量·ci·nuitka·skill
aqi005 小时前
15天学会AI应用开发(七)有了大模型为什么还要引入RAG
人工智能·python·大模型·ai编程·ai应用
金銀銅鐵7 小时前
用 Python 实现 Take-Away 游戏
python·游戏
copyer_xyf8 小时前
Agent 流程编排
后端·python·agent
copyer_xyf8 小时前
Agent RAG
后端·python·agent
copyer_xyf8 小时前
【RAG】向量数据库:milvus
后端·python·agent
copyer_xyf9 小时前
Agent 记忆管理
后端·python·agent
星云穿梭1 天前
用Python写一个带图形界面的学生管理系统——完整教程
python
金銀銅鐵1 天前
用 Pygame 实现 15 puzzle
python·数学·游戏