Skip to content

Instantly share code, notes, and snippets.

@lindenb
Created March 6, 2014 09:58
Show Gist options
  • Save lindenb/9386477 to your computer and use it in GitHub Desktop.
Save lindenb/9386477 to your computer and use it in GitHub Desktop.
trying to connect to ucsc mysql with 'node.js'
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();
/*
$ node ucsc01.js
{ [Error: connect ECONNREFUSED]
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect',
fatal: true }
$ mysql -A -u genome -h genome-mysql.cse.ucsc.edu -P 3306 -D hg19 -e 'select now()'
+---------------------+
| now() |
+---------------------+
| 2014-03-06 01:56:36 |
+---------------------+
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment