URI format without username and password

8,341 views
Skip to first unread message

Irwan Hikmah Bayu Permadi

unread,
May 27, 2016, 5:05:42 AM5/27/16
to Redis DB
Hi,

I would like to ask about URI access to REDIS. Currently I would like to connect to Redis with non-default db like db10 for pooling. I know it can be done with the URI of redis. But my Redis does not have username and password so it rejected my connection. I've tried looking in documentation for possibility pattern connecting without username and password. 

Anyone can help to give me suggestion what I can do for this? 

I'm using redigo for the client, and "select" the db10 after I get the connection. But its not accepted by my leader. 


Thank you


Bayu Permadi

Marc Gravell

unread,
May 27, 2016, 5:20:57 AM5/27/16
to redi...@googlegroups.com
"I know it can be done with the URI of redis."

Redis just works on a socket. All you have there is an IP and a port. There is no uri or connection-string as such, unless the specific library you are using happens to provide one. And if it does: all the library is going to be doing is executing "select 10" after it has opened the connection.

We haven't seen the full conversation, but *as presented*, I would say that your leader seems to be being a bit arbitrary. What you're doing seems fine to me. It might be good to ensure that this happens before you hand the connection to any calling code, of course.

Marc

Michel Martens

unread,
May 27, 2016, 5:43:25 AM5/27/16
to redi...@googlegroups.com


On May 27, 2016 06:05, "Irwan Hikmah Bayu Permadi" <irwan...@gmail.com> wrote:
>
> Hi,
>
> I would like to ask about URI access to REDIS.

You can use the redisurl library: https://github.com/soveran/redisurl

The URL format is "redis://:auth@hostname:port/dbnumber". For example, to connect to localhost port 6379 db 10 without password you could use this URL: "redis://localhost:6379/10". The README explains how to connect. What you get after connecting is a redigo client.

Reply all
Reply to author
Forward
0 new messages