Hey thanks for your time !!!
here is what i did:
mongod --port 27001 --dbpath /var/mongodb/db/1 --bind_ip localhost
----------output:
2021-04-07T16:20:11.548+0000 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols ‘none’
2021-04-07T16:20:11.561+0000 I CONTROL [initandlisten] MongoDB starting : pid=343 port=27001 dbpath=/var/mongodb/db/1 64-bit host=Bbf90RqzomUlUQco8V
2021-04-07T16:20:11.561+0000 I CONTROL [initandlisten] db version v4.0.5
2021-04-07T16:20:11.561+0000 I CONTROL [initandlisten] git version: 3739429dd92b92d1b0ab120911a23d50bf03c412
2021-04-07T16:20:11.561+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.1.1g 21 Apr 2020
2021-04-07T16:20:11.561+0000 I CONTROL [initandlisten] allocator: system
2021-04-07T16:20:11.561+0000 I CONTROL [initandlisten] modules: none
2021-04-07T16:20:11.561+0000 I CONTROL [initandlisten] build environment:
2021-04-07T16:20:11.561+0000 I CONTROL [initandlisten] distarch: x86_64
2021-04-07T16:20:11.561+0000 I CONTROL [initandlisten] target_arch: x86_64
2021-04-07T16:20:11.561+0000 I CONTROL [initandlisten] options: { net: { bindIp: “localhost”, port: 27001 }, storage: { dbPath: “/var/mongodb/db/1” } }
2021-04-07T16:20:11.591+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=256M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
2021-04-07T16:20:12.561+0000 I STORAGE [initandlisten] WiredTiger message [1617812412:561144][343:0x7f17381e6ca8], txn-recover: Set global recovery timestamp: 0
2021-04-07T16:20:12.565+0000 I RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0)
2021-04-07T16:20:12.586+0000 I CONTROL [initandlisten]
2021-04-07T16:20:12.586+0000 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2021-04-07T16:20:12.586+0000 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2021-04-07T16:20:12.586+0000 I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
2021-04-07T16:20:12.586+0000 I CONTROL [initandlisten]
2021-04-07T16:20:12.588+0000 I STORAGE [initandlisten] createCollection: admin.system.version with provided UUID: c4b8ee1d-7c02-4ea7-b8e4-d151d2b4667c
2021-04-07T16:20:12.599+0000 I COMMAND [initandlisten] setting featureCompatibilityVersion to 4.0
2021-04-07T16:20:12.606+0000 I STORAGE [initandlisten] createCollection: local.startup_log with generated UUID: b9f915b5-8d86-4c7e-8015-07d31b471053
2021-04-07T16:20:12.616+0000 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory ‘/var/mongodb/db/1/diagnostic.data’
2021-04-07T16:20:12.618+0000 I NETWORK [initandlisten] waiting for connections on port 27001
2021-04-07T16:20:12.666+0000 I STORAGE [LogicalSessionCacheRefresh] createCollection: config.system.sessions with generated UUID: 806b8521-bea9-4a6e-a1b0-1e52bd1d0152
2021-04-07T16:20:12.681+0000 I INDEX [LogicalSessionCacheRefresh] build index on: config.system.sessions properties: { v: 2, key: { lastUse: 1 }, name: “lsidTTLIndex”, ns: “config.system.sessions”, expireAfterSeconds: 1800 }
2021-04-07T16:20:12.681+0000 I INDEX [LogicalSessionCacheRefresh] building index using bulk method; build may temporarily use up to 500 megabytes of RAM
2021-04-07T16:20:12.683+0000 I INDEX [LogicalSessionCacheRefresh] build index done. scanned 0 total records. 0 secs
on another window tried to connect mongo:
bash-4.4# mongo --port 27001 -u ‘m103-admin’ -p ‘m103-pass’
--------------------------- output:
MongoDB shell version v4.0.5
connecting to: mongodb://127.0.0.1:27001/?gssapiServiceName=mongodb
2021-04-07T16:44:43.387+0000 E QUERY [js] Error: Authentication failed. :
connect@src/mongo/shell/mongo.js:328:13
@(connect):1:6
exception: connect failed
then tried this:
mongo --port 27001 -u ‘m103-admin’ -p ‘m103-pass’ --authenticationDatabase ‘admin’
MongoDB shell version v4.0.5
connecting to: mongodb://127.0.0.1:27001/?authSource=admin&gssapiServiceName=mongodb
2021-04-07T16:48:02.827+0000 E QUERY [js] Error: Authentication failed. :
connect@src/mongo/shell/mongo.js:328:13
@(connect):1:6
exception: connect failed
Lost again !!! thanks for your help !!!