Access Auth Protect MongoDB Database From Terminal Get link Facebook X Pinterest Email Other Apps By Hasib Kamal - October 24, 2017 ->mongo ->use databaseName ->db.auth("userName","userPassword"); Now you can access ->db.showCollections(); Read more
MongoDB Secured Connection Get link Facebook X Pinterest Email Other Apps By Hasib Kamal - October 15, 2017 <?php date_default_timezone_set("Asia/Dhaka"); $host = '192.168.0.1'; $pass = 'databasePassword'; $user = 'databaseUsername'; $dbName = 'databaseName'; $nameOfCollection = 'collectionName'; $connection = new MongoClient("mongodb://${user}:${pass}@$host", array ("db" => $dbName)); $db = $connection->selectDB($dbName); $COLL_collection = new MongoCollection($db, $ nameOfCollection ); Read more
MongoDB Auth User DB Access ACL Get link Facebook X Pinterest Email Other Apps By Hasib Kamal - September 10, 2017 CASE 1 : Red Hat Server Directory : /etc/mongod.conf Before : #security : Before : security: authorization: enable CASE 2 : Other Linux Directory : /etc/mongod.conf Before : #auth=true After : auth=true Read more
Auth User From Terminal to access MongoDB Database Get link Facebook X Pinterest Email Other Apps By Hasib Kamal - September 10, 2017 mongo -u userName -p userPassword localhost/databaseName Read more
MongoDB Connection From PHP Get link Facebook X Pinterest Email Other Apps By Hasib Kamal - September 06, 2017 By Authenticate User : $user = 'testUser'; $pass = '123456'; $connection = new MongoClient("mongodb://${user}:${pass}@localhost", array("db" => "testDB")); Without Authenticate User: $host = 'localhost'; $nidCollection = 'nids'; $connection = new MongoClient("mongodb://{$host}"); $db = $connection->nidservice; $COLL_nid = $db->$nidCollection; Read more
MongoDB Create User Get link Facebook X Pinterest Email Other Apps By Hasib Kamal - August 30, 2017 use reporting db . createUser ( { user : "reportsUser" , pwd : "12345678" , roles : [ { role : "read" , db : "reporting" }, { role : "read" , db : "products" }, { role : "read" , db : "sales" }, { role : "readWrite" , db : "accounts" } ] } ) Authenticate User Creation for Single Database use products db . createUser ( { user : "accountUser" , pwd : "password" , roles : [ "readWrite" , "dbAdmin" ] } ) Read more