Node.js and DB connection

I have tried them all, but using node.js it is impossible for me to establish a connection to the MySQL database on the server
Error connecting: connect ECONNREFUSED 127.0.0.1:3306

But is there a possibility to create a connection to the database? Because otherwise it is useless to think about using node.js

This server for database

I think i am getting similar issues that may be related, No responses yet for me either.

1 Like

I am also waiting for answers to find out if there is a possibility to use node.js without problems.

Is the database server running on your local computer or on a remote server?

remote server

But 127.0.0.1 is your localhost. Are you trying to setup a remote connection to a remote server but using 127.0.0.1?

No Teodor
The target is set on remote server and the connection parameters are correct (Host = localhost: 3306)

So you are sure that you properly setup a remote target to the server where your database is hosted?
Are you sure the port and host name are correct?
Are you using a Server Connect connection option in the Database Manager and not Direct connection?

As on your screenshot i see you are using the DIRECT connection option, which will never work as you are trying to access a remote database using localhost / 127.0.0.1 host:

When I open the Connections panel and click on new connection I get Direct Database Connection and not server connection

Marzio, you cannot access the remote server using a direct connection and host/address localhost or 127.0.0.1

OK Teodor
I understood that I can’t but Wappler doesn’t allow me anything else

How and where is the mySQL Server installed? On your local computer or remotely?

You need to setup the Direct Connection first, using the proper host and port for a remote connection. Then setup the server connect connection using localhost for your selected target.

mySql Server Is locate remote (hosting)

I haven’t understood much
If I set up a direct connection with the data of the remote database, then nothing works

What do you mean by “nothing works”? Please explain your issue a little more detailed, so we can understand what your issues are.

This is the first


test result

then