Closed
Description
Create an Azure Database for MySQL 5.7 instance and attempt to connect to it. The following exception is thrown:
Error: MySQL server is requesting the old and insecure pre-4.1 auth mechanism.Upgrade the user password or use the {insecureAuth: true} option.
at Handshake.UseOldPasswordPacket (F:\mysql\lib\protocol\sequences\Handshake.js:85:15)
at Protocol._parsePacket (F:\mysql\lib\protocol\Protocol.js:280:23)
at Parser.write (F:\mysql\lib\protocol\Parser.js:76:12)
at Protocol.write (F:\mysql\lib\protocol\Protocol.js:39:16)
at Socket.<anonymous> (F:\mysql\lib\Connection.js:103:28)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at TCP.onread (net.js:548:20)
--------------------
at Protocol._enqueue (F:\mysql\lib\protocol\Protocol.js:141:48)
at Protocol.handshake (F:\mysql\lib\protocol\Protocol.js:52:41)
at Connection.connect (F:\mysql\lib\Connection.js:130:18)
at Object.<anonymous> (F:\Code\Projects\azure-mysql\index.js:9:12)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
I believe this is the same problem as mysql-net/MySqlConnector#259 with a spurious error message due to Handshake.js assuming all packets starting with 0xFE are requesting old auth.