mysql2
Version:
fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS
19 lines (16 loc) • 401 B
Markdown
##
https://dev.mysql.com/doc/refman/8.0/en/caching-sha2-pluggable-authentication.html
```js
const mysql = require('mysql');
mysql.createConnection({
authPlugins: {
caching_sha2_password: mysql.authPlugins.caching_sha2_password({
onServerPublikKey: function (key) {
console.log(key);
},
serverPublicKey: 'xxxyyy',
overrideIsSecure: true, //
}),
},
});
```