By SpecC
Hi,
I can connect to my DO managed DB via SQL workbench without issue. However, when I try and connect via my local lambda Node JS code, I receive the following error…
An Error… { Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client code: ‘ER_NOT_SUPPORTED_AUTH_MODE’, errno: 1251, sqlMessage: ‘Client does not support authentication protocol requested by server; consider upgrading MySQL client’, sqlState: ‘08004’, fatal: true }
… my mysql looks like so…
mysql.createConnection({
host : removed_for_post,
user : process.env["DO_u"],
password : process.env["DO_p"],
port : '25060',
database : 'defaultdb',
ssl_mode: 'REQUIRED',
ssl : {
ca : fs.readFileSync('./ca-certificate.txt')
}
… and I have updated to latest mysql library. I’ve also tried connecting without the ssl_mode and ssl options, same error message.
Any ideas?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
https://www.digitalocean.com/docs/databases/mysql/how-to/manage-users-and-databases/#password-encryption is the answer. I created a new user and used the Legacy – MySQL 5.x auth.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.