admin管理员组文章数量:1279177
Is it possible to disable the database URL accessibility check when initializing the Prisma client?
I'm building a Next.js app locally, and the database is hosted at mysql.hostinger:3306
, but it is not accessible remotely.
As a result, during the build process, Prisma throws the following error:
PrismaClientInitializationError:
Can't reach database server at mysql.hostinger:3306
I can't run the build on the hosting server because my hosting plan doesn't allow it.
Is it possible to disable the database URL accessibility check when initializing the Prisma client?
I'm building a Next.js app locally, and the database is hosted at mysql.hostinger:3306
, but it is not accessible remotely.
As a result, during the build process, Prisma throws the following error:
PrismaClientInitializationError:
Can't reach database server at mysql.hostinger:3306
I can't run the build on the hosting server because my hosting plan doesn't allow it.
Share Improve this question asked Feb 25 at 8:22 Eli TrefEli Tref 1421 silver badge9 bronze badges1 Answer
Reset to default 0You have a local database that you use for development, right? Surely you're not coding blindly without a database, building for production and testing there?
What you should be doing is using environment variables: in your local environment, the database URL should point to your own computer; in production it would point to the hosted DB.
Here's NextJs documentation on environment variables. And this is how to configure Prisma.
本文标签:
版权声明:本文标题:next.js - Is it possible to disable the database URL accessibility check when initializing the Prisma client? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741219774a2360744.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论