After I had a chance to think about this (was busy during my initial response), the problem is not with
mongoimport but with the special character.
Since you were getting en error message with just the end portion of your password and cluster name per your original message:
I’m assuming the special character was an
& and you had everything after that character in the error message.
& character is a special character in Linux which will run the command in the background. If you typed
ctrl + c to end that command you should have seen something similar to the following:
+ Exit 1 mongoimport <any characters up to the &>
You could also just escape the
& (or any other shell specific special character such as
*) by preceding that character with a
\&). This will stop the shell from treating that character as special and treating it as the literal value that it is.
This would happen on any tool that you typed that password into on the command line (at least in a Linux/Mac based system). I’m assuming most times, you’re typing the password in at a prompt, in which case you don’t need to escape the special character as you’re no longer working with prompt directly.
Hopefully this clears up what was going on and that I didn’t muddy the waters trying to explain what was happening.