Answer the question
In order to leave comments, you need to log in
How to fix mysql_native_password error?
Good evening everyone!
I create a Web application with authorization on Node.js + Passport.js + Sequelize with Mysql dialect
The essence of the problem is as follows: I
created a file to import all models from the models folder, I add the following code to the main project file
models.sequelize.sync().then(function() {
console.log('All good')
}).catch(function(err) {
console.log(err, "Where is wrong")
});
{ SequelizeConnectionError: Client does not support authentication protocol requested by server; consid
er upgrading MySQL client
at Utils.Promise.tap.then.catch.err (C:\node.js\tests\sequelize\node_modules\sequelize\lib\dialects
\mysql\connection-manager.js:149:19)
at tryCatcher (C:\node.js\tests\sequelize\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (C:\node.js\tests\sequelize\node_modules\bluebird\js\release\p
romise.js:512:31)
at Promise._settlePromise (C:\node.js\tests\sequelize\node_modules\bluebird\js\release\promise.js:5
69:18)
at Promise._settlePromise0 (C:\node.js\tests\sequelize\node_modules\bluebird\js\release\promise.js:
614:10)
at Promise._settlePromises (C:\node.js\tests\sequelize\node_modules\bluebird\js\release\promise.js:
689:18)
at Async._drainQueue (C:\node.js\tests\sequelize\node_modules\bluebird\js\release\async.js:133:16)
at Async._drainQueues (C:\node.js\tests\sequelize\node_modules\bluebird\js\release\async.js:143:10)
at Immediate.Async.drainQueues [as _onImmediate] (C:\node.js\tests\sequelize\node_modules\bluebird\
js\release\async.js:17:14)
at runCallback (timers.js:763:18)
at tryOnImmediate (timers.js:734:5)
at processImmediate (timers.js:716:5)
name: 'SequelizeConnectionError',
parent:
{ Error: Client does not support authentication protocol requested by server; consider upgrading MyS
QL client
at Packet.asError (C:\node.js\tests\sequelize\node_modules\mysql2\lib\packets\packet.js:714:13)
at ClientHandshake.Command.execute (C:\node.js\tests\sequelize\node_modules\mysql2\lib\commands\com
mand.js:28:22)
at Connection.handlePacket (C:\node.js\tests\sequelize\node_modules\mysql2\lib\connection.js:513:28
)
at PacketParser.onPacket (C:\node.js\tests\sequelize\node_modules\mysql2\lib\connection.js:81:16)
at PacketParser.executeStart (C:\node.js\tests\sequelize\node_modules\mysql2\lib\packet_parser.js:7
6:14)
at Socket.<anonymous> (C:\node.js\tests\sequelize\node_modules\mysql2\lib\connection.js:89:29)
at Socket.emit (events.js:180:13)
at addChunk (_stream_readable.js:274:12)
at readableAddChunk (_stream_readable.js:261:11)
at Socket.Readable.push (_stream_readable.js:218:10)
at TCP.onread (net.js:581:20)
code: 'ER_NOT_SUPPORTED_AUTH_MODE',
errno: 1251,
sqlState: '08004',
sqlMessage: 'Client does not support authentication protocol requested by server; consider upgradi
ng MySQL client' },
original:
{ Error: Client does not support authentication protocol requested by server; consider upgrading MyS
QL client
at Packet.asError (C:\node.js\tests\sequelize\node_modules\mysql2\lib\packets\packet.js:714:13)
at ClientHandshake.Command.execute (C:\node.js\tests\sequelize\node_modules\mysql2\lib\commands\com
mand.js:28:22)
at Connection.handlePacket (C:\node.js\tests\sequelize\node_modules\mysql2\lib\connection.js:513:28
)
at PacketParser.onPacket (C:\node.js\tests\sequelize\node_modules\mysql2\lib\connection.js:81:16)
at PacketParser.executeStart (C:\node.js\tests\sequelize\node_modules\mysql2\lib\packet_parser.js:7
6:14)
at Socket.<anonymous> (C:\node.js\tests\sequelize\node_modules\mysql2\lib\connection.js:89:29)
at Socket.emit (events.js:180:13)
at addChunk (_stream_readable.js:274:12)
at readableAddChunk (_stream_readable.js:261:11)
at Socket.Readable.push (_stream_readable.js:218:10)
at TCP.onread (net.js:581:20)
code: 'ER_NOT_SUPPORTED_AUTH_MODE',
errno: 1251,
sqlState: '08004',
sqlMessage: 'Client does not support authentication protocol requested by server; consider upgrading MySQL client' } } 'Wrong'
Answer the question
In order to leave comments, you need to log in
So do you want to use Native Pluggable Authentication or not?
If you want, then update the client (Node.js + Passport.js + Sequelize) to support it.
If you do not want, then configure MySQL with a different authorization.
https://dev.mysql.com/doc/refman/5.7/en/pluggable-...
https://dev.mysql.com/doc/refman/5.7/en/server-sys...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question