Redis - 用户名、密码和数据库? [英] Redis - Username, password and db?
问题描述
Redis 中可以使用用户名、密码和数据库吗?
Is it possible to use username, password and db in Redis?
这个问题的原因是因为在官方pyramid_redis_sessions文档(http://pyramid-redis-sessions.readthedocs.io/en/latest/gettingstarted.html ) 参数...
The reason for this question is because in the official pyramid_redis_sessions documentation ( http://pyramid-redis-sessions.readthedocs.io/en/latest/gettingstarted.html ) the parameter...
redis.sessions.url = redis://username:password@localhost:6379/0
...(例如在 Python/Pyramid production.ini
中使用)建议使用用户名、密码和数据库.
... (to use inside a Python/Pyramid production.ini
, for example) suggests the use of username, password and db.
但是,我在互联网上没有找到任何解释如何创建链接到 Redis 上的数据库的用户和密码的内容.在链接 https://stackoverflow.com/a/34781633/3223785 中有一些关于使用数据库(Redis).
However I have not found anything on the internet that explains how to create a user and password linked to a db on Redis. In the link https://stackoverflow.com/a/34781633/3223785 there is some information about using a db (Redis).
有可能创建密码(https://stackoverflow.com/a/7548743/3223785).不过好像是参数redis.sessions.url
以外的一个使用范围.
There is the possibility of creating a password ( https://stackoverflow.com/a/7548743/3223785 ). But it seems that is a scope of use other than the parameter redis.sessions.url
.
注意: pyramid_redis_sessions 提供了 Pyramid 的 ISession 接口的实现,使用 Redis 作为其后端.
NOTE: The pyramid_redis_sessions provides a implementation of Pyramid’s ISession interface, using Redis as its backend.
@Jacky
推荐答案
在 Redis 中,AUTH 命令用于向 Redis 服务器进行身份验证.一旦客户端通过服务器身份验证,它就可以切换到该服务器上配置的任何数据库.没有针对特定数据库的内置身份验证.
In the Redis, the AUTH command is used to authenticate to the Redis server. Once a client is authenticated against a server, it can switch to any of the DBs configured on there server. There is no inbuilt authentication against a specific database.
这篇关于Redis - 用户名、密码和数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!