I'm getting the following error when trying to connect to power bi "ODBC: ERROR [08S01] [MySQL][ODBC 1.4(a) Driver]Lost connection to MySQL server at 'waiting for initial communication packet', system error: 10060".
My bi connector is on vm where my mongo server is allocated, I created a service which is running and I have no error logs but I still can't connect using powerbi. This is the mongosqld.conf I'm using
systemLog:
path: '/var/log/mongosqld.log'
net:
bindIp: '127.0.0.1'
port: 3307
mongodb:
net:
uri: 'server_ip'
ssl:
enabled: false
auth:
username: user
password: pwd
security:
enabled: true
What I'm doing wrong?!
Related
Each time I try connecting to my localhost server using SSL/TLS certificate I get an error which says, connection attempt failed: HostUnreachable
Things I've tried
I've tried restarting my system
I've tried changing the tls to SSL
I've also cross-checked the file path for mongodb.pem,
I'm really at a loss.
This is the code I ran and the error I'm getting
MongoDB shell version v5.0.9
connecting to: mongodb://localhost:27017/?compressors=disabled&gssapiServiceName=mongodb
Error: couldn't connect to server localhost:27017, connection attempt failed: HostUnreachable: Connection reset by peer :
connect#src/mongo/shell/mongo.js:372:17
#(connect):2:6
exception: connect failed
exiting with code 1
This is my mongo.cfg file
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# Where and how to store data.
storage:
dbPath: C:\Program Files\MongoDB\Server\5.0\data
journal:
enabled: true
# engine:
# wiredTiger:
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: C:\Program Files\MongoDB\Server\5.0\log\mongod.log
# network interfaces
net:
port: 27017
bindIp: 127.0.0.1
#processManagement:
security:
authorization: enabled
#operationProfiling:
#replication:
#sharding:
## Enterprise-Only Options:
#auditLog:
#snmp:
This is the command I used to connect to the server
mongo --tls --tlsCAFile mongodb.pem --host localhost
Detail about the issue.
I have converted my MongoDB instance to a standalone ReplicaSet using the following config.
systemLog:
destination: file
path: /opt/homebrew/var/log/mongodb/mongo.log
logAppend: true
storage:
dbPath: /opt/homebrew/var/mongodb
net:
bindIp: 127.0.0.1
replication:
replSetName: "rs0"
security:
authorization: "enabled"
keyFile: /Users/username/mongodb.key
Using the following Mongo URI to connect to my MongoDB instance
"mongodb://username:password#127.0.0.1:27017/dbName?authSource=admin&replicaSet=rs0"
using the URI I can connect to my MongoDB through Studio3T but when I use this URI in my Node app through Mongoose it never connects, nor gives any error.
Following are the Screenshots for rs.status() output displaying details of member
member data from rs.status
Additional details.
NodeJs version: v14.19.1
Mongoose version: 6.3.2
MongoDB version: 5.0.7
I'm trying different ways to connect to Mongo Atlas but it haven't been possible. I may be forgetting something but the documentation is no very detailed. Maybe I need to pay to have that feature?
Currently this is my mongosqld.conf file:
systemLog:
path: '/logs/mongosqld.log'
verbosity: 10
mongodb:
net:
uri: 'cluster0-shard-00-02.abcde.mongodb.net:27017/?replicaSet=atlas-24535-shard-0&ssl=true&w=majority&retryWrites=true'
auth:
username: "user"
password: "password"
mechanism: "SCRAM-SHA-1"
source: "dbName"
net:
bindIp: localhost
port: 3307
security:
enabled: true
And I keep getting this error:
SCHEMA [manager] error initializing schema: unable to execute command: server selection error: context deadline exceeded, current topology: { Type: ReplicaSetNoPrimary, Servers: [{ Addr: cluster0-shard-00-02.abcde.mongodb.net:27017, Type: Unknown, Average RTT: 0, Last error: connection() error occured during connection handshake: OCSP verification failed: no OCSP cache provided }, ] }
Any clue or can you point me in the right direction?
My BI Connector version is 2.14.3 and is dockerized.
Enable SSL and it will work
net:
uri: 'cluster0-shard-00-02.abcde.mongodb.net:27017/?replicaSet=atlas-24535-shard-0&ssl=true&w=majority&retryWrites=true' # https://docs.mongodb.com/manual/reference/connection-string/#mongodb-uri
ssl:
enabled: true
From the same client, I can connect to my remote mongodb using this string:
mongodb://siteadmin:mypassword#myip:27017
But from the shell when I run
mongo "mongodb://siteadmin:mypassword#myip:27017"
DB.prototype._authOrThrow#src/mongo/shell/db.js:1608:20
#(auth):6:1
#(auth):1:2
exception: login failed
root#shadow:~/website-fron
Any idea?
My config is simple:
security:
authorization: 'enabled'
net:
port: 27017
bindIp: 0.0.0.0
This is my mongo.conf
storage:
dbPath: /var/lib/mongodb
journal:
enabled: true
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log
net:
port: 27017
bindIp: 0.0.0.0
security:
authorization: enabled
And I'm starting it via systemctl which does this:
/usr/bin/mongod --quiet --auth --config /etc/mongod.conf
Created an admin user like so:
mongo
> use admin
> db.createUser({ user:"user001", pwd:"pwd001", roles:[{role:"root", db:"admin"}]})
I can access mongo on EC2 via:
mongo -u user001 -p pwd001 --authenticationDatabase admin
However, when I try to access it on my local via:
mongo -u user001 -p pwd001 --authenticationDatabase admin --host 58.17.53.6
I get this error:
MongoDB shell version: 3.0.4
connecting to: 58.17.53.6:27017/test
2017-10-30T19:42:33.302-0700 W NETWORK Failed to connect to 58.17.53.6:27017 after 5000 milliseconds, giving up.
2017-10-30T19:42:33.304-0700 E QUERY Error: couldn't connect to server 58.17.53.6:27017 (58.17.53.6), connection attempt failed
at connect (src/mongo/shell/mongo.js:181:14)
at (connect):1:6 at src/mongo/shell/mongo.js:181
exception: connect failed
Also, my security group for instance looks like this:
Any help would be appreciated!