I am starting a brand new PlanetScale backed project, with a Prisma setup. I followed the instruction on this official documentation (aside from changing the name of the database) and after locally proxying into the database, I found myself unable to run npx prisma db push
command, getting the following error:
server does not allow insecure connections, client must use SSL/TLS
I am very new to database set ups, and prior to this never had an idea I would need to configure any of these connections as I thought they were dealt with as part of what database set-up I was using.
I know that mySql, what I am using through Prisma, needs either an SSL or TLS before it will perform any interactions on a database, but I have yet to find any way to set this up for my environment.
I have seen references to adding ?tls={true}
to the end of my DATABASE_URL
but that did nothing. Furthermore, given that the provided DATABASE_URL
was provided by PlanetScale as
DATABASE_URL='mysql://un5pbmobnc73muwvbo77:************@us-east.connect.psdb.cloud/*******?ssl={"rejectUnauthorized":true}'
I attempted to change {"rejectUnauthorized":true}
to {"rejectUnauthorized":false}
. This also changed nothing.
More elaborate solutions involving objects are the parameters resulted in my database not being found altogether.
I know SSL is deprecated and I should not use it, but not only do I not know how to properly add TLS to my mySQL, but as you may have already determined, I'm finding myself somewhat unable to fully grasp the concept of its implementation at all.