You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m trying to self-host Dub.co using Azure MySQL instead of PlanetScale. However, the code currently imports @planetscale/database, which expects a PlanetScale Data API over HTTP. When running locally, the Next.js app is using the Edge runtime, and it fails to connect to a normal MySQL port with the following repeated error:
Steps to Reproduce
Clone Dub repo
Set DATABASE_URL="mysql://:@.mysql.database.azure.com:3306/?sslaccept=strict"
@natilusky,
The problem arises because the @planetscale/database library is designed specifically for PlanetScale which differs from a standard MySQL server connection. The Dub codebase includes some areas where it directly uses PlanetScale , thus making it incompatible with a standard MySQL .
To resolve this, you can set up a local PlanetScale development environment. If you don’t already have a PlanetScale account, you can refer to the Dub local development guide this.
@natilusky
Next.js edge runtime cannot connect using the traditional TCP, which actually the Azure MySQL uses. Edge functions dont support the normal database like tcp used by MySQL.
To resolve this issue I would suggest to use the Prisma Accelerate-it wraps your azure MySQL with the http layer, that makes it edge compatible .It works with any DB and offers connection pooling for performance
I’m trying to self-host Dub.co using Azure MySQL instead of PlanetScale. However, the code currently imports @planetscale/database, which expects a PlanetScale Data API over HTTP. When running locally, the Next.js app is using the Edge runtime, and it fails to connect to a normal MySQL port with the following repeated error:
Steps to Reproduce
The text was updated successfully, but these errors were encountered: