Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 #2390

Open
DGKSK8LIFE opened this issue Aug 19, 2020 · 5 comments

Comments

@DGKSK8LIFE
Copy link

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
@DGKSK8LIFE DGKSK8LIFE changed the title When using with express/docker-compose; error: Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client 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 Aug 19, 2020
@BalgopalPatro
Copy link

I have the same issue while connecting to MySql

@wolfymaster
Copy link

Probably related to #2233 if you are using mysql 8.x. I'm not sure why that update to support caching-sha2-password has not been merged yet.

@LetsMelon
Copy link

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.

@drwharris
Copy link

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.

thank you. Simplest fix ever

@ghuser
Copy link

ghuser commented 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'
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants