Docker, NodeJS, and MySQL 8
·Oct 17, 2022·
1 min read
Seen this error when using Docker for NodeJS and MySQL 8?
Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
It is most likely the wrong package is being used.
- mysql package does not support MySQL 8 authentication method (More info here)
- Use mysql2 package
Make sure the MySQL server is fully running before trying to connect, otherwise an error like below
Error: connect ECONNREFUSED 172.17.0.1:3306