I have a problem that I can’t understand
A site project created years ago connects correctly to the database
I then create a new project which will then replace the old one, but the database with the same config produce an error
I have a problem that I can’t understand
A site project created years ago connects correctly to the database
I then create a new project which will then replace the old one, but the database with the same config produce an error
Did you click - Deploy in Wappler so that your DB Docker image would spin up?
Please correct me if I’m wrong but you’re trying to connect to your db using localhost, that won’t work.
Database under globals are for connecting db <–> site (where we usually use 127.0.0.1/localhost)
If you have on target: the site and the db setted, I think you’ll see connected
For using db with wappler use direct database connection.
In this project, Docker is not used and unfortunately the database provided by the domain does not accept remote direct connection
However what I don’t understand is because in the old project the connection is ok and in the new one no
This is the old config
And this is the new project setting
What about the target config tab?
Now I’m a little confused
As I said previously, I have a site created years ago with Wappler, for which I need to create a new version, without currently modifying the existing one.
I then created a new project by adding a subdomain for a Staging target
With Wappler 6 the project options settings are slightly different as can be seen from the two screenshots (in particular the addition of the www folder)
OLD PROJECT OPTIONS
NEW PROJECT OPTIONS
NEW PROJECT TARGET STAGING
NEW PROJECT TARGET PRODUCTION
The connection tests for the two targets are correct and give a positive response.
In addition to the database currently in use by the site, I have created another identical database for staging, but as previously mentioned, unfortunately the databases of this provider cannot be managed directly remotely
TWO DATABASE
CONNECTION DB PRODUCTION - OK WITH OLD PROJECT
CONNECTION DB PRODUCTION - ERROR WITH NEW PROJECT
For database staging the error is always the same
How can this problem be solved?
I started over and partially fixed things
Now I have two databases with the same structure, one “db” for the Production target (relative to the domain) and another “dbstaging” for the Staging target (relative to the subdomain)
With Target Production the database “db” is read correctly with connection (localhost:3306)
With Target Staging the “dbstaging” database is read correctly with connection (localhost:3306)
But when I save the settings, the “dbstaging” database no longer works because Wappler replaced “localhost:3306” with “localhost:3000”
I tried changing “localhost:3000” throughout the project, but to no avail
Marzio, you need one and only one database connection for your project!! You change your target, enter this specific target connection details and save, then do the same for all your targets. Everything is explained in the docs already:
I read your suggestion, but the development target, in my case, is not local and still consists of a remote target (Staging on subdomain)
In this case I think the approach is different
Maybe I still need to add a local development target?
But in this case, how should the local target be configured?