Skip to content

Commit

Permalink
add note about DB name in connection url with mongodb atlas
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolasburk committed Nov 5, 2024
1 parent 51058d2 commit e0deae4
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ pagination_next: getting-started/setup-prisma/start-from-scratch/mongodb/connect
slugSwitch: /getting-started/setup-prisma/start-from-scratch/mongodb-
---



Learn how to create a new Node.js or TypeScript project from scratch by connecting Prisma ORM to your MongoDB database and generating a Prisma Client for database access. The following tutorial introduces you to the [Prisma CLI](/orm/tools/prisma-cli) and [Prisma Client](/orm/prisma-client).



## Prerequisites

In order to successfully complete this guide, you need:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ pagination_next: getting-started/setup-prisma/start-from-scratch/mongodb/connect
slugSwitch: /getting-started/setup-prisma/start-from-scratch/mongodb-
---



Learn how to create a new Node.js or TypeScript project from scratch by connecting Prisma ORM to your MongoDB database and generating a Prisma Client for database access. The following tutorial introduces you to the [Prisma CLI](/orm/tools/prisma-cli) and [Prisma Client](/orm/prisma-client).



## Prerequisites

In order to successfully complete this guide, you need:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,14 @@ Here's a short explanation of each component:
- `PASSWORD`: The password for your database user
- `HOST`: The host where a [`mongod`](https://docs.mongodb.com/manual/reference/program/mongod/#mongodb-binary-bin.mongod) (or [`mongos`](https://docs.mongodb.com/manual/reference/program/mongos/#mongodb-binary-bin.mongos)) instance is running
- `PORT`: The port where your database server is running (typically `27017` for MongoDB)
- `DATABASE`: The name of the database
- `DATABASE`: The name of the database. Note that if you're using MongoDB Atlas, you need to manually append the database name to the connection URL because the environment link from MongoDB Atlas doesn't contain it.

## Troubleshooting

### Error in connector: SCRAM failure: Authentication failed.

If you see the `Error in connector: SCRAM failure: Authentication failed.` error message, you can specify the source database for the authentication by [adding](https://github.com/prisma/prisma/discussions/9994#discussioncomment-1562283) `?authSource=admin` to the end of the connection string.

### Raw query failed. Code: unknown. Message: Kind: Command failed: Error code 8000 (AtlasError): empty database name not allowed.

If you see the `Raw query failed. Code: unknown. Message: Kind: Command failed: Error code 8000 (AtlasError): empty database name not allowed.` error message, be sure to append the database name to the database URL. You can find more info in this [GitHub issue](https://github.com/prisma/docs/issues/5562).
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ Here's a short explanation of each component:
- `PASSWORD`: The password for your database user
- `HOST`: The host where a [`mongod`](https://docs.mongodb.com/manual/reference/program/mongod/#mongodb-binary-bin.mongod) (or [`mongos`](https://docs.mongodb.com/manual/reference/program/mongos/#mongodb-binary-bin.mongos)) instance is running
- `PORT`: The port where your database server is running (typically `27017` for MongoDB)
- `DATABASE`: The name of the database
- `DATABASE`: The name of the database. Note that if you're using MongoDB Atlas, you need to manually append the database name to the connection URL because the environment link from MongoDB Atlas doesn't contain it.

If you see the following error: `Error in connector: SCRAM failure: Authentication failed.`, you can specify the source database for the authentication by adding `?authSource=admin` to the end of the connection string. See [this GitHub discussion](https://github.com/prisma/prisma/discussions/9994#discussioncomment-1562283) for additional details.
## Troubleshooting

### Error in connector: SCRAM failure: Authentication failed.

If you see the `Error in connector: SCRAM failure: Authentication failed.` error message, you can specify the source database for the authentication by [adding](https://github.com/prisma/prisma/discussions/9994#discussioncomment-1562283) `?authSource=admin` to the end of the connection string.

### Raw query failed. Code: unknown. Message: Kind: Command failed: Error code 8000 (AtlasError): empty database name not allowed.

If you see the `Raw query failed. Code: unknown. Message: Kind: Command failed: Error code 8000 (AtlasError): empty database name not allowed.` error message, be sure to append the database name to the database URL. You can find more info in this [GitHub issue](https://github.com/prisma/docs/issues/5562).
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ pagination_next: getting-started/setup-prisma/add-to-existing-project/mongodb/co
slugSwitch: /getting-started/setup-prisma/add-to-existing-project/mongodb-
---



Learn how to add Prisma ORM to an existing Node.js or TypeScript project by connecting it to your database and generating a Prisma Client for database access. The following tutorial introduces you to [Prisma CLI](/orm/tools/prisma-cli), [Prisma Client](/orm/prisma-client), and [Prisma Introspection](/orm/prisma-schema/introspection).



<Admonition type="tip">

If you're migrating to Prisma ORM from Mongoose, see our [Migrate from Mongoose guide](/orm/more/migrating-to-prisma/migrate-from-mongoose).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ pagination_next: getting-started/setup-prisma/add-to-existing-project/mongodb/co
slugSwitch: /getting-started/setup-prisma/add-to-existing-project/mongodb-
---



Learn how to add Prisma ORM to an existing Node.js or TypeScript project by connecting it to your database and generating a Prisma Client for database access. The following tutorial introduces you to [Prisma CLI](/orm/tools/prisma-cli), [Prisma Client](/orm/prisma-client), and [Prisma Introspection](/orm/prisma-schema/introspection).



<Admonition type="tip">

If you're migrating to Prisma ORM from Mongoose, see our [Migrate from Mongoose guide](/orm/more/migrating-to-prisma/migrate-from-mongoose).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ Here's a short explanation of each component:
- `PASSWORD`: The password for your database user
- `HOST`: The host where a [`mongod`](https://docs.mongodb.com/manual/reference/program/mongod/#mongodb-binary-bin.mongod) (or [`mongos`](https://docs.mongodb.com/manual/reference/program/mongos/#mongodb-binary-bin.mongos)) instance is running
- `PORT`: The port where your database server is running (typically `27017` for MongoDB)
- `DATABASE`: The name of the database
- `DATABASE`: The name of the database. Note that if you're using MongoDB Atlas, you need to manually append the database name to the connection URL because the environment link from MongoDB Atlas doesn't contain it.

> If you see the following error: `Error in connector: SCRAM failure: Authentication failed.`, you can specify the source database for the authentication by [adding](https://github.com/prisma/prisma/discussions/9994#discussioncomment-1562283) `?authSource=admin` to the end of the connection string.
## Troubleshooting

### Error in connector: SCRAM failure: Authentication failed.

If you see the `Error in connector: SCRAM failure: Authentication failed.` error message, you can specify the source database for the authentication by [adding](https://github.com/prisma/prisma/discussions/9994#discussioncomment-1562283) `?authSource=admin` to the end of the connection string.

### Raw query failed. Code: unknown. Message: Kind: Command failed: Error code 8000 (AtlasError): empty database name not allowed.

If you see the `Raw query failed. Code: unknown. Message: Kind: Command failed: Error code 8000 (AtlasError): empty database name not allowed.` error message, be sure to append the database name to the database URL. You can find more info in this [GitHub issue](https://github.com/prisma/docs/issues/5562).
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@ Here's a short explanation of each component:
- `PASSWORD`: The password for your database user
- `HOST`: The host where a [`mongod`](https://docs.mongodb.com/manual/reference/program/mongod/#mongodb-binary-bin.mongod) (or [`mongos`](https://docs.mongodb.com/manual/reference/program/mongos/#mongodb-binary-bin.mongos)) instance is running
- `PORT`: The port where your database server is running (typically `27017` for MongoDB)
- `DATABASE`: The name of the database
- `DATABASE`: The name of the database. Note that if you're using MongoDB Atlas, you need to manually append the database name to the connection URL because the environment link from MongoDB Atlas doesn't contain it.

> If you see the following error: `Error in connector: SCRAM failure: Authentication failed.`, you can specify the source database for the authentication by [adding](https://github.com/prisma/prisma/discussions/9994#discussioncomment-1562283) `?authSource=admin` to the end of the connection string.
## Troubleshooting

### Error in connector: SCRAM failure: Authentication failed.

If you see the `Error in connector: SCRAM failure: Authentication failed.` error message, you can specify the source database for the authentication by [adding](https://github.com/prisma/prisma/discussions/9994#discussioncomment-1562283) `?authSource=admin` to the end of the connection string.

### Raw query failed. Code: unknown. Message: Kind: Command failed: Error code 8000 (AtlasError): empty database name not allowed.

If you see the `Raw query failed. Code: unknown. Message: Kind: Command failed: Error code 8000 (AtlasError): empty database name not allowed.` error message, be sure to append the database name to the database URL. You can find more info in this [GitHub issue](https://github.com/prisma/docs/issues/5562).

0 comments on commit e0deae4

Please sign in to comment.