question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When using with express/docker-compose; Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client

See original GitHub issue
node_1   | 
node_1   | /app/node_modules/mysql/lib/protocol/sequences/Sequence.js:47
node_1   |   var err  = new Error(code + ': ' + packet.message);
node_1   |              ^
node_1   | Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
node_1   |     at Handshake.Sequence._packetToError (/app/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
node_1   |     at Handshake.ErrorPacket (/app/node_modules/mysql/lib/protocol/sequences/Handshake.js:123:18)
node_1   |     at Protocol._parsePacket (/app/node_modules/mysql/lib/protocol/Protocol.js:291:23)
node_1   |     at Parser._parsePacket (/app/node_modules/mysql/lib/protocol/Parser.js:433:10)
node_1   |     at Parser.write (/app/node_modules/mysql/lib/protocol/Parser.js:43:10)
node_1   |     at Protocol.write (/app/node_modules/mysql/lib/protocol/Protocol.js:38:16)
node_1   |     at Socket.<anonymous> (/app/node_modules/mysql/lib/Connection.js:88:28)
node_1   |     at Socket.<anonymous> (/app/node_modules/mysql/lib/Connection.js:526:10)
node_1   |     at Socket.emit (events.js:314:20)
node_1   |     at Socket.EventEmitter.emit (domain.js:486:12)
node_1   |     --------------------
node_1   |     at Protocol._enqueue (/app/node_modules/mysql/lib/protocol/Protocol.js:144:48)
node_1   |     at Protocol.handshake (/app/node_modules/mysql/lib/protocol/Protocol.js:51:23)
node_1   |     at Connection.connect (/app/node_modules/mysql/lib/Connection.js:116:18)
node_1   |     at Object.<anonymous> (/app/main.ts:12:4)
node_1   |     at Module._compile (internal/modules/cjs/loader.js:1251:30)
node_1   |     at Module.m._compile (/app/node_modules/ts-node/src/index.ts:858:23)
node_1   |     at Module._extensions..js (internal/modules/cjs/loader.js:1272:10)
node_1   |     at Object.require.extensions.<computed> [as .ts] (/app/node_modules/ts-node/src/index.ts:861:12)
node_1   |     at Module.load (internal/modules/cjs/loader.js:1100:32)
node_1   |     at Function.Module._load (internal/modules/cjs/loader.js:962:14)
node_1   | npm ERR! code ELIFECYCLE
node_1   | npm ERR! errno 1
node_1   | npm ERR! backend@1.0.0 go: `ts-node main.ts`
node_1   | npm ERR! Exit status 1
node_1   | npm ERR! 
node_1   | npm ERR! Failed at the backend@1.0.0 go script.
node_1   | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
node_1   | 
node_1   | npm ERR! A complete log of this run can be found in:
node_1   | npm ERR!     /root/.npm/_logs/2020-08-19T16_57_55_755Z-debug.log

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:4
  • Comments:5

github_iconTop GitHub Comments

13reactions
ghusercommented, Jan 12, 2021
npm uninstall mysql
npm i mysql2

const mysql = require('mysql'); const mysql = require('mysql2');

const connection = mysql.createConnection({
    host: 'server',
    user: 'u',
    password: 'p',
    database: 'schema_name'
});
7reactions
LetsMeloncommented, Oct 29, 2020

I had the same issue. Now I’m using mysql2 and it works. Hopefully this will be improved quickly so that I can switch back again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MySQL 8.0 - Client does not support authentication protocol ...
When creating the database using Docker , you can accomplish this by instructing MySQL Server to implement the legacy authentication plugin.
Read more >
B.3.2.4 Client does not support authentication protocol
mysql Client does not support authentication protocol requested by server; consider upgrading MySQL client. To deal with this problem, the preferred ...
Read more >
Directus error " ER_NOT_SUPPORTED_AUTH_MODE
You can get the error ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client if ...
Read more >
MYSQL: Client does not support authentication protocol…
I started working on this article after I solved an issue connecting my express app to my local MySQL server. I got the...
Read more >
How to fix "Client does not support authentication protocol ...
How to fix "Client does not support authentication protocol requested by server; consider upgrading MySQL client"? · If the . · Extract the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found