Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
986 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am getting "localhost refused connection" error.
With same parameters I can open the connection in workbench ok.
'use strict';
var http = require('http');
var port = process.env.PORT ||1137;
http.createServer(function (req, res) {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('Hello World333333\n');
}).listen(port);
var mysql = require('mysql');
var con = mysql.createConnection({
host: "localhost",
user: "root",
password: "Nigel7557@"
});
It was a problem with cors.
Fixed now, thanks for your help.
Hi @Nigel Wright , welcome to Microsoft Q&A forum.
Could you please try changing the localhost to '127.0.0.1', also check if the port you are connecting to in workbench is correct i.e. 3306?
Just one last thing, are you using the MySQL on-premise or Azure MySQL.?