https://github.com/sidorares/node-mysql2/blob/93df7a8f5c7f56d80285ebdd001508567cbe84e9/lib/auth_plugins/caching_sha2_password.js#L35 You could use xorRotating func to fix: https://github.com/normano/node-mysql2/blob/72aaf4a07680d26edb5ac6bb828027207e97e004/lib/auth_41.js#L137