Mike Ross
BABetter Auth
•Created by Mike Ross on 4/12/2025 in #help
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:
4 replies
BABetter Auth
•Created by Mike Ross on 4/5/2025 in #help
Better Auth + MySQL - Failing Schema Generation
Hey guys,
I have been trying to get better-auth up and running with my existing NextJS project. To do so I have been following the instructions in the better auth documentation: (https://www.better-auth.com/docs/adapters/mysql). Despite that I am unable to generate the respective schemas using the
npx @better-auth/cli@latest generate
command.
In my project I use yarn as my package manager. For whatever reason trying to install the mysql2/promise
package, as per documentation, already fails.
After some research I noticed that there is a package called mysql2-promise
available via yarn, but using this package does also not allow me run the generate-schema command.
I hope someone has already figured out a way to use a MySQL database in combination with Better Auth.8 replies