Host issues with mysql!

Idk what this categorizes as, but ok. My issue is this:

const mysql = require(“mysql”);
const con = mysql.createConnection({
host: “”,
user: “root”,
password: process.env.MYSQLPASSWORD,
database: “ramfish”
con.connect(err => {
if(err) console.log(err.message);

When i run this, all i get is an error saying: connect ETIMEDOUT or connect ECONNREFUSED
and i donw know what to put in the host name, i tried my and my servers ip adress and localhost. I need help.

Only port 3000 can be exposed to the internet. However, if your running the database inside of your project you should use for the IP.

1 Like