PrismaclientInitializationerror:连接器中的错误:错误创建数据库连接VSCODE

发布于 2025-02-13 12:44:47 字数 1400 浏览 0 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

污味仙女 2025-02-20 12:44:47

您正在使用 Prisma 中的.env文件格式,如果使用 mongodb atlas **,则应像这样。
1.在数据库中选择连接选择“连接到应用程序”
2.复制URL并以**数据库< / strong>在.env文件中的** < / strong>

mongodb+srv://zeta:<password>@zetaapplication.kciyn8z.mongodb.net/?retryWrites=true&w=majority

3.将所有内容删除mongodb.net / exthere east

mongodb+srv://zeta<password>@zetaapplication.kciyn8z.mongodb.net/your_db_name

you are working with prisma in .env file format of DATABASE_URL should be like this if using mongodb Atlas ** follow the steps:
1.in database choose connect the select "connect to application"
2.copy the url and past it as ** DATABASE_URL
in .env file for example

mongodb+srv://zeta:<password>@zetaapplication.kciyn8z.mongodb.net/?retryWrites=true&w=majority

3.remove everything after mongodb.net / and replace by your database name like below

mongodb+srv://zeta<password>@zetaapplication.kciyn8z.mongodb.net/your_db_name
怪我闹别瞎闹 2025-02-20 12:44:47

在.env文件中检查您的数据库_url,并确保您的数据库URL不在“”中。如果是,请卸下“两侧”。

Check your DATABASE_URL in your .env file and make sure your database url is not inside a " ". if it is, remove the " at both sides.

2025-02-20 12:44:47

我已经注意到,由于某种原因,如果您使用的是移动热点添加VPN A,则由于某种原因无法在移动热点上工作。

I have noticed it doesnt work on mobile hotspot for some reason if you are using mobile hotspot add vpn a it should work fine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文