Help needed, mysql2 driver cannot connect to the mysqldatabase (nextjs, drizzle,mysql)
I have project which contains mysql and nextjs app. The mysql container is running fine.
When i try to deploy my nextjs it fails on the build because it cannot find the hostname
here's the error message:
Error: getaddrinfo ENOTFOUND schoolput-database-112c11
at e.createConnection (/app/.next/server/chunks/5516.js:5:60532)
at /app/.next/server/chunks/1323.js:6:6804
at t.a (/app/.next/server/webpack-runtime.js:1:918)
at 90469 (/app/.next/server/chunks/1323.js:6:6710)
at t (/app/.next/server/webpack-runtime.js:1:143)
at /app/.next/server/chunks/1323.js:6:12167
at t.a (/app/.next/server/webpack-runtime.js:1:918)
at 28695 (/app/.next/server/chunks/1323.js:6:12115)
at t (/app/.next/server/webpack-runtime.js:1:143)
at /app/.next/server/app/(auth)/signup/page.js:1:3791 {
code: 'ENOTFOUND',
errno: -3008,
sqlState: undefined
}
and here's my create connection file
here's my env
DB_HOST=schoolput-database-112c11
Thanks

3 Replies
It should work, can you share the envs via DM?
I have different projects running with drizzle, check this
and in Dokploy app I just set this env
Thank for responding, lemme boot my laptop
Solverd created an example of T3 Application with mysql database https://github.com/Dokploy/examples/tree/main/t3
GitHub
examples/t3 at main · Dokploy/examples
Examples to deploy on Dokploy. Contribute to Dokploy/examples development by creating an account on GitHub.