Problems with Database Query

Database manager always expects a direct connection.
It’s something totally different and independent of targets. Database manager -> always a direct connection.

Server connect connections -> always per target.

Ok I configured the direct connection to the connection created locally and read the database perfectly
Now step to the remote section (production and select the connection in Global and change the settings on remote?

Ok I configured the direct connection to the connection created locally and read the database perfectly
Now step to the remote section (production and select the connection in Global and change the settings on remote?

Development mode
After performing Deploy a first time with errors and a second time without errors, the development of the local action is as per screeshot

Production mode
Again Deployed twice to avoid errors, but the development of the action gave a positive result and listed all the records correctly

The error says connection refused and then gives the address 127.0.0.1:3306 which is the local loopback IP address in all computers hosts file, its the same as localhost in essence.

You said you database was a remote one to some cloud based database server, therefore your database connection should be using an IP Address to connect. So this is a confusing result.

Thanks Paul
In fact it is the first time I use a Cloud NodeJS solution (on Hetzner) with Ubuntu.
I begin to think that the problem is due to the database created on the Ubuntu Cloud Server, because sometimes he work and sometimes no.
I certainly don’t think it’s a Wappler problem
At this point, if I don’t solve the problems soon, even though I had discarded the idea for the fact that it didn’t rely out, I think I have to recroll me and better pass to a docker database.
I have to search a tutorial for configuring a docker database for local and remote connection

Have you tried connecting to it using a third party database application like SQLStudio Pro / DB Solo, etc.

There are 2 side to this.

  1. Are all your connection settings correct
    Database Host / Address e.g. 149.28.79.214
    Database Type e.g. MariaDB, MySQL, Postgres
    Database Port e.g. 3306
    Database Name e.g. myNewCloudDatabase
    Database User e.g. root
    Database Password

If you have all those credentials, and a third party database tool, and can connect, then you know that side is working fine first off.

If you get an error connecting with all the correct details, look at 2 things

  1. Most Likely, is there a firewall blocking all connections that you need to open up on the database server side, and if that is the case, and you search google for “WhatsMyIP” and enter your remote IP and it works then great, thats the issue.
    This issue can cause the appearance of erratic behaviour, because one day you are connected perfectly, and the next day you not.
    The reason for this is probably because your internet service provider changes your IP address dynamically, and each time they do you will have to open a new IP manually in the database firewall.

  2. Less likely reason, the database has a read only user as well as a read/write user, I mention this because Hetzner loves auto creating those for you. An offshoot to this may also be that root is locked as a user by the system, and possibly you can not connect via root but rather a different username like admin which has the same privileges as root.

1 Like

The Ubuntu Database mySql work perfectly with Navicat

Perfect, well that one possible issue sorted out.

So now what Docker Hosting provider are you using, still Hetzner, or have you moved to one of the others?

Edit: What is the cloud database service, Hetzner, or something else.

The site is set with Docker / NodeJS on Hetzner Cloud server. Everything apparently perfect regarding configuration. The Index page works correctly both on local (Docker) and on remote (Hetzner) The connection to the database was not configured in the target tabs of Wappler (local and remote) because it was manually created via database manager, both for local and remotely. Apparently working Now for example I created two query actions that stand at the same database table, one works on remote and another no. Neither works on local Now it’s a late. Dimani will try to understand the origin of the errors with debugging, as recommended by Teodor. We will see if I solve Thanks

Hi Teodor
I have checked all the settings and with the target positioned on production (remote) it can easily work both the action and the Table Product List (I am monitoring if the operation is stable)
Instead if they place the target on development (local) the action does not work and consequently the list
The debug result Network HXR:


The debug result Console:

Well what have you entered in the database connection settings for the local target then? Something is not correct there.

Developer local DB

Marzio first you say both targets connect to the same remote database, now you show a localhost connection to your database.

The error message says the connection to the localhost database is refused - wrong credentials, not database at all or similar issues.

Are you working with a local database on the local server at all? Or do you only need to use the remote one on both targets as explained in some of the posts above.

Sorry but it is really hard to understand your idea reading your posts.

Ok the direct connection is already addressed to remote database, even for the local target
Now I also put the configuration in Global on a remote db
Check the operation now

there is still something I don’t understand
I have two actions for the same table, one without conditions and another with some “filter container” conditions.
Using the local target the first lists the products correctly, and the second no
Using the remote target all two work
I hope I explained the problem

FIRST ACTION

RESULT

SECOND ACTION


RESULT

Note that when I deploy on target production (remote) I have to always do it twice, because the first time the following error appears: