Can you recommend a mysql driver for deno that isn't a complete dead end?
mysql2 port: never updated.
mysql driver: doesn't support strings
mysql connector from Oracle: no one cares to port to Deno.
ALL, I mean ALL I can think about is going back to superb PHP PDO. What a challenge...
17 Replies
How to use MySQL2 with Deno | Deno Docs
MySQL is the most popular database in the
Did you ever end up finding anything @Bairdy?
I'm trying to get it to work but having issues connecting https://discord.com/channels/684898665143206084/684898665151594506/1187550860746698833
i'm using knex with mysql2 from
npm:
and it just worksdoes your server have SSL disabled?
yep (internal only)
maybe its something with the ssl implementation and node compat
Yeah, probably.
If the mysql2 npm module isn't working, that's definitely a compatibility issue we should jump on - @toninho do deno if you have a reproduction case we could use to validate, that would be awesome
i guess @TehShrike can help with a reproduction case
yeah, I can try to write up something more thorough, though about half the details are here: https://discord.com/channels/684898665143206084/684898665151594506/1187550860746698833 the rest of the details are: mysql 8.0.35, from the default macOS installer from https://dev.mysql.com/downloads/mysql/ with no my.cnf file.
At some point I guess the default mysql settings started requiring TLS
Besides passing in (or not) that
ssl
property to createConnection
, I also passed in host
, user
, database
, password
Let me know if you want me to try anything else
When I try connecting to PlanetScale with ssl: { rejectUnauthorized: false }
, I get an error with the message "unavailable: unable to connect to branch tcancv32qlrt" and then "Uncaught Error: read UNKNOWN"So if I try to connect to a PlanetScale DB with the options you mention using mysql2 on npm, I should probably see what you are seeing
hah, my PlanetScale database was asleep. One moment
I am successfully able to connect to PlanetScale with
ssl: { rejectUnauthorized: false }
I am also able to connect to PS with ssl: { rejectUnauthorized: true }
So everything seems cool there. The issue seems to be when connecting to a local database that requires SSL.so... are u providing SSL on the local db and the server?
I'm not providing a cert, but I am enabling SSL.
When connecting to local:
Yeah, I feel like now we are in the land of certificate handling, and Deno and Node have different mechanisms of handling SSL handshakes (if indeed Node is able to connect to your local DB)
Yes, I am able to connect to the local db with node. I was also to connect to the local db in Deno using this native Deno library: https://github.com/denodrivers/mysql
Hm, got it.
Want me to create an issue?