#ECONNREFUSED sql server

57 messages · Page 1 of 1 (latest)

gusty meteorBOT
#

@hushed haven

Blocked Web TLDs

To maintain a wholesome and friendly environment we block all links to websites using certain TLDs. Your message has been deleted.

Detected TLD(s)
xxx, xxx

hushed haven
#

there was no links bruih

gusty meteorBOT
#

@hushed haven

Blocked Web TLDs

To maintain a wholesome and friendly environment we block all links to websites using certain TLDs. Your message has been deleted.

Detected TLD(s)
xxx

hushed haven
#

connect ECONNREFUSED 40.00.00.000:3306

#

is the error im getting

#
const {Sequelize} = require('sequelize')
require('dotenv').config()

const sequelize = new Sequelize("namelessdb", process.env.DB_USERNAME, process.env.DB_PASSWORD, {
  host: '40.00.00.000',
  dialect: 'mariadb',
});

module.exports = sequelize
#

everything was working fine on my local enviornment till i moved it to production

#

google no help

clear turret
#

Are you sure that IP is correct?

limpid ravine
#

How is the db hosted? Does it require hosts that connect to it to be white listed?

hushed haven
#

connecting it database with django was no problem but im switching off django

hushed haven
#

just a place holder to not give out the ip

clear turret
#

So you probably messed up the port and or IP somewhere?

limpid ravine
#

Can you show us whatever error message you're getting?

hushed haven
clear turret
#

Can you connect from a different client?

hushed haven
clear turret
clear turret
#

That command worked on the same machine where sequelize didn't work, correct?

hushed haven
#

because its refusing to connect to the dataabse

last laurel
#

If you are sure you got the correct ip, contact the provider

#

I'm assuming they host it all

hushed haven
#

dang ok

clear turret
#

Might just be that your hosting provider is blocking traffic on certain ports? lol

graceful lance
#

Shot in the dark: whats the config value for bind_address of the mariadb server? is it listening on a specific ip address or the general 0.0.0.0 placeholder for all interfaces?

#

might also be worth checking if the user you are trying to connect to is restricted to certain hosts

SELECT user,host FROM mysql.user;

check what host values are allowed for the user you want to connect as

graceful lance
#

so unless your are trying to connect as "test", you need to connect from localhost (as in, the database and your application must be on the same server). Where is your application running? directly on the same server, or maybe in a docker container?

hushed haven
#

idk what a docker is, everything is on a vps

#

the script and the database are in the vps

limpid ravine
#

So everything is running on the same VPS???

hushed haven
limpid ravine
#

Have you tried using localhost instead of the IP address?

graceful lance
#

you HAVE to use either localhost or 127.0.0.1, using the public ip of the server will likely fail when connecting (user is not allowed to connect from remote interface)
sorry if that wasn't obvious from my previous message

graceful lance
#

its using ipv6 to connect, you sure that server supports that?

#

can you try explicitly 127.0.0.1?

hushed haven
#

how that work

graceful lance
#

huh does what work?

hushed haven
#

it works

#

using host 127.0.0.1

#

so why doesnt localhost work

graceful lance
#

seems like the vps is not capable of resolving ipv6 addresses

hushed haven
#

ohhhhh

#

can i ask whats the difference between ipv4 and ipv6

graceful lance
#

localhost resolves to ::1 on ipv6, 127.0.0.1 on ipv4
sequelize will auto-select ipv6 when you give it localhost, but your server doesnt know how ipv6 works so ::1 cant connect anywhere

hushed haven
#

wow

#

ty you so much for taking your time with me