Reputation: 31
i'm trying to connect to mysql database hosted on ec2 instence on aws, but i'm getting the error: errno: -111, code: 'ECONNREFUSED', syscall: 'connect', address: '15.188.51.165', port: 3306, fatal: true
my code :
const con = mysql.createConnection({
host: "********.com",
user: "root",
password: "******",
database : '***[![enter image description here][1]][1]',
port:'3306',
multipleStatements: true
});
Upvotes: 0
Views: 957
Reputation: 1611
To be able to connect to mysql server in an ec2 from outside you need to verify these points 0. Check if your mysql server is accessible from your ec2
These rules apply for all/most OS. If these points align you should be able to access your server.
Upvotes: 0