VoltDB / voltdb-client-go

VoltDB Golang Client Library
MIT License
32 stars 19 forks source link

How to use username and password in golang sql? #43

Closed OceanW closed 7 years ago

OceanW commented 7 years ago

I setup a voltdb, where user name and password are operator and mech. I can use sqlcmd --user=operator --password=mech to connect.

sql.Open("voltdb", "operator:mech@tcp(localhost:21212)") This seems don't work.

What's the right way to specify the data source?

nshi commented 7 years ago

Hi @OceanW, I see that you have closed the issue. I hope you have found the solution to your question. If not, using the following should be able to connect and authenticate with VoltDB.

db, err := sql.Open("voltdb", "voltdb://operator:mech@localhost")
OceanW commented 7 years ago

Yes, I found it in the driver source code. Thank you all the same.