#Handshake timeout error on mySQL

33 messages · Page 1 of 1 (latest)

narrow tusk
#
// ---> DATABASE
await mysql.connect()
const db = new QuickDB({ driver: mysql })

the error points to where I assign my db
I'm using quickdb.js with promise-mysql

project ID: ad4f96c1-5839-4882-89ea-53b1a95f4719

quiet hawkBOT
#

Project ID: ad4f96c1-5839-4882-89ea-53b1a95f4719

earnest epoch
#

Are you using the correct environment variables?

narrow tusk
#

yes, I think so

const mysql = new MySQLDriver({
  host: process.env.MYSQLHOST,
  user: process.env.MYSQLUSER,
  password: process.env.MYSQLPASSWORD,
  database: process.env.MYSQLDATABASE,
});
#

Maybe I should store my data as a json in a discord message Troll

earnest epoch
#

Those are indeed the correct variables

#

Let me do some testing

narrow tusk
#

Alright, thanks for your help Brody!

earnest epoch
#

if possible do you wanna provide me with a full code snippet? code that just connects to the db and would print a success message

narrow tusk
#
async function connectDB() {
    // ---> DATABASE
    const mysql = new MySQLDriver({
        host: process.env.MYSQLHOST,
        user: process.env.MYSQLUSER,
        password: process.env.MYSQLPASSWORD,
        database: process.env.MYSQLDATABASE,
    });

    await mysql.connect()
    const db = new QuickDB({ driver: mysql })
}
connectDB().then(console.log("success")).catch(error => console.error(error))

something like this?

earnest epoch
#

yep exactly

#

specify a port in that config

#

port: process.env.MYSQLPORT

narrow tusk
#

Alright

#

"Client does not support authentication protocol requested by server; consider upgrading MySQL client"

earnest epoch
#

lol

narrow tusk
earnest epoch
#

this?

narrow tusk
#

yea, that's the package I'm using

earnest epoch
narrow tusk
#

wait wait, no, using quickdb.js

earnest epoch
#

ah okay thats better

#

i shall investigate

narrow tusk
#

thanks a ton 😭

earnest epoch
#

so while quick.db has been updated recently, the underlying mysql package hasn't, and doesn't support mysql v8

narrow tusk
#

Darn, okay thanks Brody!
I guess I'll use a different library

#

I appreciate your help!

earnest epoch
#

mysql2 works

narrow tusk
#

Alright, I'll check it out, thank you :D