mirror of
https://github.com/danbulant/sql2csv
synced 2026-05-19 04:18:33 +00:00
Create mysql connection
This commit is contained in:
parent
be6e1ad583
commit
4846f4f6f3
1 changed files with 9 additions and 3 deletions
12
index.js
12
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
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue