From 4846f4f6f344dfa81fc77368d50d351d5ea6d11e Mon Sep 17 00:00:00 2001 From: danbulant Date: Sat, 28 Sep 2019 15:08:42 +0200 Subject: [PATCH] Create mysql connection --- index.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index e629d3c..52cecb2 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,6 @@ const fs = require("fs"); const sql2csv = require("./sql2csv"); - +const mysql = require("mysql"); const configLoc = "config.yml"; var config = {}; @@ -34,7 +34,8 @@ log(); const s2c = new sql2csv({ logging: true, - skipMysqlCheck: true + skipMysqlCheck: true, + colors: true }); log(); @@ -76,8 +77,13 @@ if(config.username == undefined){ warn("Undefined username, using root"); config.username = "root"; } - if(config.password == undefined){ warn("Undefined password, using (empty)"); config.password = ""; } + +var con = mysql.createConnection({ + host: config.host, + user: config.username, + password: config.password +});