Error: Too many connections (MySQL)
I currently use better-auth in combination with a MySQL database. I use NextJS to render my website. I noticed that when making repeated changes (re-renders) better-auth throws an error: . I have looked through previous posts and found that someone had the same issue when using a Prisma client. Given that I do not initialize the connection to the database myself, I was wondering how to store the connection during development?
This is what my configuration looks like:
This is the error shown in the console:
1 Reply
may be pools are not cleanup on dev so may be you need to flush them unless they remain open and raise a conflict -
this is sth i found with their docs so may be the flag for termination might not be right but this is what could find and we can circle back if this is not the right solution