MySQL Connection on Node.JS -
i have problem when try connect mysql database hosted ovh on nodejs server. here code :
var mysql = require('mysql'); var connection = mysql.createconnection({ host : 'my_ip', port : '3306', user : 'my_user', password : 'my_pass', connecttimeout : 10000 }); connection.connect(function(err) { if (err) { console.error('error connecting: ' + err.stack); return; } console.log('connected'); });
but :
error connecting: error: connect etimedout
everytime, not matter do, changing timeout, remove port or else. idea ? i'm running on archlinux x86_64
i found answer : ovh doesn't allow customers use mysql database out of services means if want run code using mysql ovh database, have run code ovh server.
Comments
Post a Comment