Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道 Redis 默认有 16 个数据库,但是如果我需要添加另一个数据库,我该如何使用 redis-py 呢?
你不能。数据库数量在 Redis 中不是动态参数。
您可以通过更新 Redis 配置文件(databases 参数)并重新启动服务器来更改它。
从客户端(Python 或其他),您可以使用“GET CONFIG DATABASES”命令检索此值。但是“SET CONFIG DATABASES xxx”命令将被拒绝。