Error Too many connections with Drizzle + MySQL2

I have my DB setup as follow:

import { drizzle } from "drizzle-orm/mysql2";
import mysql from "mysql2/promise";
import * as schema from "./schema";

const poolConnection = mysql.createPool({
    host: "localhost",
    user: "root",
    database: "nextjs",
});

const db = drizzle(poolConnection);

export { db, schema };


I keep getting the error Too many connections after refreshing the page several times. How can I fix it?
Screenshot_2024-03-09_at_7.30.06_PM.png
Was this page helpful?