The content of this page has been automatically translated by AI. If you encounter any problems while reading, you can view the corresponding content in Chinese.
You can use the MongoDB shell client (please see the installation documentation) on a CVM instance to connect to TencentDB for MongoDB for data management. Be sure to use the latest version of MongoDB client suite.
When using connection string access for MongoDB, if the password contains special characters, they need to be escaped to URL encoding for normal recognition. For example, @ needs to be escaped to %40.
See the figure:
Connection in different authentication methods
In Connect Instances, it is noted that TencentDB for MongoDB default provides two usernames, rwuser and mongouser, which support MONGODB-CR and SCRAM-SHA-1 authentication methods respectively. For these two authentication methods, the shell parameters are different. See below for details.
SCRAM-SHA-1 authentication (mongouser)
The default user mongouser and all new users created in the console use SCRAM-SHA-1 authentication. Their shell connection parameters are exactly the same as in the Quick Start section, with no need to add additional parameters. Example as follows:
Please note that only the default user rwuser uses MONGODB-CR authentication. Its shell connection parameters need to specify the authentication method as MONGODB-CR, example as follows: