Error querySrv ENODATA _mongodb._tcp.456d in MongoDB Compass
Hello Guys, I create a MongoDb Atlas and I use MongoDB Compass to help connect.
Below is MongoDB Atlas connection string:
mongodb+srv://dungdt2:123@456d@cluster0.qzf2k.mongodb.net/test?authSource=admin&replicaSet=atlas-124ezu-shard-0&readPreference=primary&appname=MongoDB%20Compass&ssl=true
And my username and password is dungdt2/123@456d. And when I try connect by using MongoDB compass i got an error querySrv ENODATA _mongodb._tcp.456d. You can see image as below:
I think I have problem with password and it containt @(a special character).
How can I solve it?
-
N1
Nitin Kumar Feb 09 2022
This is the real problem with your password and you need to decode it. I think you only need to decode special characters (@).
In your case, you need to replace
@
to%40
.Change
123@456d
to123%40456d
and it will be solved for you.mongodb+srv://dungdt2:123%40456d@cluster0.qzf2k.mongodb.net/test?authSource=admin&replicaSet=atlas-124ezu-shard-0&readPreference=primary&appname=MongoDB%20Compass&ssl=true
Other, If you use other special characters you can refer to ASCII Encoding below:
Character From Windows-1252 From UTF-8 space %20 %20 ! %21 %21 " %22 %22 # %23 %23 $ %24 %24 % %25 %25 & %26 %26 ' %27 %27 ( %28 %28 ) %29 %29 * %2A %2A + %2B %2B , %2C %2C - %2D %2D . %2E %2E / %2F %2F 0 %30 %30 1 %31 %31 2 %32 %32 3 %33 %33 4 %34 %34 5 %35 %35 6 %36 %36 7 %37 %37 8 %38 %38 9 %39 %39 : %3A %3A ; %3B %3B < %3C %3C = %3D %3D > %3E %3E ? %3F %3F @ %40 %40 I hope it's useful for you.
* Type maximum 2000 characters.
* All comments have to wait approved before display.
* Please polite comment and respect questions and answers of others.