Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function createMySQLGateway(port: number, queryProcessor: MySQLQueryProcessor) {
let server = mysql.createServer();
server.listen(port);
console.log(`MySQL Gateway listening on port: ${port}`);
console.log(`you can connect to it using \`mysql --host=127.0.0.1 --port=${port}\``);
let connectionId = 0;
server.on('connection', function(conn) {
connectionId++;
console.log(`New connection ${connectionId}`);
conn.serverHandshake({
protocolVersion: 10,
serverVersion: '5.7.11',
connectionId,
statusFlags: 2,
characterSet: CHARSETS['UTF8MB4_UNICODE_CI'],
capabilityFlags