{"id":29,"date":"2020-09-23T16:29:13","date_gmt":"2020-09-23T09:29:13","guid":{"rendered":"http:\/\/warawich.com\/?p=29"},"modified":"2020-09-23T16:29:13","modified_gmt":"2020-09-23T09:29:13","slug":"mongodb-%e0%b9%80%e0%b8%9e%e0%b8%b4%e0%b9%88%e0%b8%a1-auth-%e0%b8%81%e0%b8%a3%e0%b8%93%e0%b8%b5%e0%b8%95%e0%b9%89%e0%b8%ad%e0%b8%87%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%84%e0%b8%a7%e0%b8%b2%e0%b8%a1","status":"publish","type":"post","link":"https:\/\/warawich.com\/index.php\/2020\/09\/23\/mongodb-%e0%b9%80%e0%b8%9e%e0%b8%b4%e0%b9%88%e0%b8%a1-auth-%e0%b8%81%e0%b8%a3%e0%b8%93%e0%b8%b5%e0%b8%95%e0%b9%89%e0%b8%ad%e0%b8%87%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%84%e0%b8%a7%e0%b8%b2%e0%b8%a1\/","title":{"rendered":"MongoDB \u0e40\u0e1e\u0e34\u0e48\u0e21 auth \u0e01\u0e23\u0e13\u0e35\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e04\u0e27\u0e32\u0e21\u0e1b\u0e25\u0e2d\u0e14\u0e20\u0e31\u0e22"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">1. Connect DB \u0e41\u0e25\u0e49\u0e27 run command \u0e15\u0e32\u0e21\u0e42\u0e19\u0e49\u0e19<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>use admin\ndb.createUser(\n  {\n    user: \"myUserAdmin\",\n    pwd: passwordPrompt(), \/\/ or cleartext password\n    roles: &#91; { role: \"userAdminAnyDatabase\", db: \"admin\" }, \"readWriteAnyDatabase\" ]\n  }\n)\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">2. Shutdown Mongo<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>db.adminCommand( { shutdown: 1 } )<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">3. Add config mongod.conf  \u0e15\u0e32\u0e21\u0e19\u0e35\u0e49<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>security:\n    authorization: enabled<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">4. Start mongo<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Connect DB \u0e41\u0e25\u0e49\u0e27 run command \u0e15\u0e32\u0e21\u0e42\u0e19\u0e49\u0e19 2. Shutdown Mongo 3. Add config mongod.conf \u0e15\u0e32\u0e21\u0e19\u0e35\u0e49 4. Start mongo<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-29","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/warawich.com\/index.php\/wp-json\/wp\/v2\/posts\/29","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/warawich.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/warawich.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/warawich.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/warawich.com\/index.php\/wp-json\/wp\/v2\/comments?post=29"}],"version-history":[{"count":1,"href":"https:\/\/warawich.com\/index.php\/wp-json\/wp\/v2\/posts\/29\/revisions"}],"predecessor-version":[{"id":30,"href":"https:\/\/warawich.com\/index.php\/wp-json\/wp\/v2\/posts\/29\/revisions\/30"}],"wp:attachment":[{"href":"https:\/\/warawich.com\/index.php\/wp-json\/wp\/v2\/media?parent=29"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/warawich.com\/index.php\/wp-json\/wp\/v2\/categories?post=29"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/warawich.com\/index.php\/wp-json\/wp\/v2\/tags?post=29"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}