Questions tagged «mgo»

7
服务器在SASL身份验证步骤上返回错误:身份验证失败
以下是我从GoLang获得的MongoDB连接拨号。但是它返回一个紧急消息“ SASL身份验证步骤服务器返回错误:身份验证失败。 ”。我的用户名,密码,hostAddrs和dbName是正确的。我在这里想念什么? dbName: = os.Getenv("ENV_DBNAME") userName: = os.Getenv("ENV_DBUSER") password: = os.Getenv("ENV_DBPASS") dbHost: = os.Getenv("ENV_DBHOST") mongoDialInfo: = & mgo.DialInfo { Addrs: [] string { dbHost }, Database: dbName, Username: userName, Password: password, Timeout: 60 * time.Second, } sess, err: = mgo.DialWithInfo(mongoDialInfo) if (err != nil) { panic(err) }
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.