Search code examples
pythonredispyramid

Redis - Username, password and db?


Is it possible to use username, password and db in Redis?

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

... (to use inside a Python/Pyramid production.ini, for example) suggests the use of username, password and db.

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).

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.

NOTE: The pyramid_redis_sessions provides a implementation of Pyramid’s ISession interface, using Redis as its backend.

@Jacky


Solution

  • 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.