{"id":746,"date":"2017-09-22T23:20:32","date_gmt":"2017-09-22T15:20:32","guid":{"rendered":"http:\/\/www.withonly.com\/?p=746"},"modified":"2017-09-22T23:20:32","modified_gmt":"2017-09-22T15:20:32","slug":"unable-to-authenticate-using-sasl-protocol-mechanism-scram-sha-1","status":"publish","type":"post","link":"https:\/\/blog.5danyuan.com\/?p=746","title":{"rendered":"Unable to authenticate using sasl protocol mechanism SCRAM-SHA-1"},"content":{"rendered":"<p>\u6700\u8fd1\u5728\u5199\u4e00\u4e2a\u6570\u636e\u6e05\u6d17\u5de5\u5177\uff0c\u4ee5\u8c03\u6574MongoDB\u7684\u6570\u636e\u5185\u5bb9\u3002\u5de5\u5177\u4f7f\u7528\u4e86MongoDB\u5b98\u65b9\u63d0\u4f9b\u7684Nuget\u5305\uff0c\u4f46\u662f\u5728\u8fde\u63a5\u7684\u65f6\u5019\uff0c\u4e00\u76f4\u65e0\u6cd5\u6210\u529f\uff0c\u603b\u662f\u8fde\u63a5\u8d85\u65f6\u62a5Unable to authenticate using sasl protocol mechanism SCRAM-SHA-1\u5f02\u5e38\u3002<\/p>\n<p>\u540e\u6765\u5728Stackoverflow\u4e0a\u627e\u5230\u89e3\u51b3\u65b9\u6cd5\uff0c\u539f\u6765\u95ee\u9898\u51fa\u5728\u8fde\u63a5\u5b57\u7b26\u4e32\u4e0a\u3002<\/p>\n<p>\u539f\u6765\u6211\u7684\u8fde\u63a5\u5b57\u7b26\u4e32\u662f\uff1amongodb:\/\/username:password@ip\/mydb\uff0c\u5c31\u51fa\u73b0\u00a0Unable to authenticate using sasl protocol mechanism SCRAM-SHA-1 \u5f02\u5e38\u3002\u5728\u5b98\u7f51\u7684\u6587\u6863\u91cc\u6709\u4e00\u53e5\u8bdd Above, the database by the name of \u201cmydb\u201d is where the credentials are stored for the application.<\/p>\n<p>\u539f\u6765\u8fde\u63a5\u5b57\u7b26\u4e32\u91cc\u8981\u5199\u5b58\u50a8\u6388\u6743\u4fe1\u606f\u7684\u6570\u636e\u5e93\u540d\u79f0\uff0c\u9ed8\u8ba4\u662f\u4e3aadmin\u3002\u6240\u4ee5\u5728\u8fde\u63a5\u5b57\u7b26\u4e32\u91cc\u4e0d\u9700\u8981\u63d0\u4f9b\u6570\u636e\u5e93\u540d\u79f0\u4e86\u3002\u5728\u540e\u9762\u53ef\u4ee5\u901a\u8fc7 var db = client.GetDatabase(&#8220;dbname&#8221;); \u6765\u5b9a\u4f4d\u5230\u9700\u8981\u64cd\u4f5c\u7684\u6570\u636e\u5e93\u4e0a\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u5728\u5199\u4e00\u4e2a\u6570\u636e\u6e05\u6d17\u5de5\u5177\uff0c\u4ee5\u8c03\u6574MongoDB\u7684\u6570\u636e\u5185\u5bb9\u3002\u5de5\u5177\u4f7f\u7528\u4e86MongoDB\u5b98\u65b9\u63d0\u4f9b\u7684Nuget\u5305\uff0c\u4f46\u662f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,5],"tags":[297],"class_list":["post-746","post","type-post","status-publish","format-standard","hentry","category-a-short-word","category-daily","tag-mongodb"],"_links":{"self":[{"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/posts\/746","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=746"}],"version-history":[{"count":0,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/posts\/746\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=746"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=746"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=746"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}