I'm working behind a proxy and I'm trying to access a following public database.
The connection works using a mysql client, from my workplace:
$ mysql -A -u genome -h genome-mysql.cse.ucsc.edu -P 3306 -D hg19 -e 'select now()'
+---------------------+
| now() |
+---------------------+
| 2014-03-06 01:56:36 |
+---------------------+
Now, I'm trying to do the same thing using node:
var mysql = require('mysql');
var connection = mysql.createConnection({
debug:true,
trace:true,
host : 'genome-mysql.cse.ucsc.edu',
port : 3306,
database: 'hg19',
user : 'genome',
password: ''
});
connection.connect(function(err) {if(err!=null) console.log(err);});
connection.end();
It works from my home but it raises an error from my workplace
{ [Error: connect ECONNREFUSED]
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect',
fatal: true }
same error using : _socket: '/var/run/mysqld/mysqld.sock'
as connect ECONNREFUSED - node js , sql
Any suggestion on how to fix this ?