我在使用 node-mysql2、react、sequelize 和 jest 测试项目时遇到问题。此问题仅在测试期间发生。
Encoding not recognized: 'cesu8' (searched as: 'cesu8')
at Object.getCodec (project/node_modules/mysql2/node_modules/iconv-lite/lib/index.js:106:23)
at Object.getDecoder (project/node_modules/mysql2/node_modules/iconv-lite/lib/index.js:122:23)
at Object.<anonymous>.exports.decode (project/node_modules/mysql2/lib/parsers/string.js:9:23)
at Packet.Object.<anonymous>.Packet.readNullTerminatedString (project/node_modules/mysql2/lib/packets/packet.js:373:23)
at Function.Object.<anonymous>.Handshake.fromPacket (project/node_modules/mysql2/lib/packets/handshake.js:18:31)
at ClientHandshake.Object.<anonymous>.ClientHandshake.handshakeInit (project/node_modules/mysql2/lib/commands/client_handshake.js:98:38)
at ClientHandshake.Object.<anonymous>.Command.execute (project/node_modules/mysql2/lib/commands/command.js:40:20)
at Connection.Object.<anonymous>.Connection.handlePacket (project/node_modules/mysql2/lib/connection.js:515:28)
at PacketParser.onPacket (project/node_modules/mysql2/lib/connection.js:94:16)
at PacketParser.executeStart (project/node_modules/mysql2/lib/packet_parser.js:77:14)
at Socket.<anonymous> (project/node_modules/mysql2/lib/connection.js:102:29)