Skip to main content

MySQL

ShipNowKit supports MySQL database system. As one of the world's most popular open-source relational databases, MySQL is renowned for its reliability, performance, and ease of use.

We recommend using Aiven as the MySQL hosting service provider. Aiven is a professional Database-as-a-Service (DBaaS) platform offering comprehensive enterprise-grade database hosting solutions.

Key benefits of hosting MySQL with Aiven:

  • Multi-cloud deployment support (AWS, GCP, Azure, etc.)
  • Free tier available (5GB storage included)
  • Enterprise-grade security
  • Flexible high-availability options
  • Professional technical support

1. Create MySQL Service

Visit the Aiven Console and log in to your account, then create a new MySQL service:

  1. Select "MySQL" from the "Create new service" page
  2. Choose a service plan (Free or Production tier)
  3. Select your cloud provider and region
  4. Configure your service name

Tip: We recommend starting with the free tier for development and testing, then upgrading to a production plan once your application is stable.

image.png

Note: For optimal performance, choose a data center in the same region as your application services.

2. Database Info

After creating the service, you'll be automatically redirected to the database details page. image.png

Aiven automatically creates a defaultdb database and an avnadmin administrator user. The Service URI for database connection is available on the details page.

Add the Service URI to environment configuration:

Set DATABASE_URL environment variable in Vercel

DATABASE_URL=mysql://[DB-USER]:[PASSWORD]@[HOST]:[PORT]/[DB]

3. Database Migration

  1. Run npm run db:use:mysql, which will:

    • Copy db/prisma/variants/mysql.prisma to db/prisma/schema.prisma
    • Execute prisma generate to create MySQL-compatible Prisma Client
  2. Run npm run db:migrate to perform database migration.

What Next?