From 2514f9b098b268de9044546666f4fc08385a14a1 Mon Sep 17 00:00:00 2001 From: alexmorenograu <61759297+alexmorenograu@users.noreply.github.com> Date: Fri, 12 Mar 2021 09:07:07 +0100 Subject: [PATCH] mysql test --- mysql.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/mysql.js b/mysql.js index 71d307c..ce17d92 100644 --- a/mysql.js +++ b/mysql.js @@ -1,12 +1,18 @@ -var mysql = require('mysql'); +const mysql = require('mysql'); +const config = require('./config'); + var con = mysql.createConnection({ host: "test-db.verdnatura.es", - user: "vicent", - password: "llopis.19263" + database: "vn", + user: "alex", + password: config.bdpassword }); con.connect(function(err) { - if (err) throw err; + if (err) { + console.error('Error connecting: ' + err.stack); + return; + } console.log("Connected!"); }); \ No newline at end of file