MongoDB Manager lets you create MongoDB databases and users for applications that store data as documents, such as many Node.js projects.
Where to find it: Databases → MongoDB.
Note: MongoDB must be installed on the server by your hosting provider. If you see MongoDB Not available or Mongo Database it is not runnning on this server, contact your provider.
The boxes at the top show how many MongoDB databases you have compared with your package limit.
Create a database
- Click Add new database.
- Enter the Database name. The panel shows the full name it will get (Database name will be set as …), which starts with your account name.
- Click Save.
Create a user and give access
- In the Database List, click Add user to this database.
- Enter a Username and a New password (twice), or generate one with the key button.
- Choose the User role: ReadWrite for your application, or ReadOnly for tools that only read data.
- Click Save.
Use Manage user to change the password or role, Delete user to remove a user, and Delete database to remove a database and all its data permanently.
Connection string
Use a connection string like this in your application, with your own values:
mongodb://USERNAME:PASSWORD@localhost:27017/DATABASE?authSource=DATABASE
If the password contains special characters such as @, : or /, URL-encode them (for example @ becomes %40).
Common problems
| Message | Solution |
|---|---|
| Database already exists / User already exists | Choose another name. |
| Invalid database name / Invalid Username | Use letters, numbers and underscores only. |
| Authentication failed in the application | Check the user, password and authSource in the connection string, and that the user was added to that database. |
| Quota reached | You reached the MongoDB database limit of your package. |
Related
Secure connection (authentication)
On current servers MongoDB runs with authentication enabled, so every connection must sign in — your databases are not reachable without a username and password. When you create your first database the panel also creates your account’s own MongoDB user, which can read and write only your own <account>_ databases and nothing belonging to anyone else.
The connection details shown in the module (host, your user name and the connection string, for example mongodb://<user>:<password>@127.0.0.1:27017/?authSource=admin) are what your application should use to connect. Keep the password private; it is generated once and shown to you here.
