What is the difference between DB Connection in DB Manager and DB Connection in Target Database section?

I’m looking for clarity on the difference, if any, between the DB Connection in DB Manager and DB Connection in Target Database section. I am using Docker hosting and NodeJS server type. In both Development and Production I am using MySql outside of the web hosting server. In development I have MySql server running on my desktop and in production I have a Digital Ocean Managed Database.

What I want for Production is for Database Manager to connect to my Production database on it’s public url (this is working) but for the Production Docker server, which is in a VPC, to connect to the database on it’s private URL.

Is this just a case of adding the details of the private access for the database to the Database section in the Production Target?

Thanks
Allan

The Database Connection in server connect points to exact the same database as the connection in the database manager.

The only different is that the one in server connect is used - server side, so on your server, while the one in the database manager is a direct remote connection. But they do point to the same thing.
Both use the same name - just can have different settings depending on the access rights.

Each target has its own database settings. Still under the same database name - but you can enter different settings per target. This way you will have different database settings for your local development - and other for your live target.

To edit the different settings - just switch to that target, edit the connections settings and save them.

In the case of docker - if you choose to use the docker database per target - docker settings auto generate the needed database connection settings , when you save your project settings. So there is no need to edit the settings separately. We even prohibit this in the from last update

Hi George, thanks for the quick response.

I understand there are different settings for each target, but there are 3 separate places to enter the database settings for each target:

  1. Database Manager > Database Connections
  2. Server Connect > Globals > Database Connections
  3. Project Settings > Targets > Database

As you said Database Manager is always remote and uses the Direct Remote Connection. Server Connect is used server side so that would be from the server I deploy the app to. So, I should enter public url for the database in the Database Manager settings, and the private url for the database in the Server Connect settings, correct?

Also, when and where are the database settings in Project Settings used?

Many thanks,
Allan

I just noticed that Target Settings have a “Custom” type in the “Database” section.

@George I am curious, when can it be helpful? I filled my external DB connection here, but nothing happens. Can’t see how it can be used. And didn’t find the answer at the forum.

I no longer even bother with the database setup in project settings. It seems pretty redundant to me now the connection is set up in globals.

1 Like

Hi, Brian! Thank you for the reply.

So, those DB connection settings in Target are obsolete, got it.
I just thought maybe it can be useful somehow.

No, the db settings aren’t absolete.

The db settings in the targets are just a quick creation method of the default ‘db’ connection.

But how does it work exactly? I’ve selected “Custom” and saved the DB credentials.

Then I am going to DB settings in Workflows Globals and start a new connection. And everything seems as usual.

Custom means you are entering all the credentials manually.

Hmm, been a while but I seem to recall last time I added db settings to a project I still had to create them in globals also?
Maybe just old age setting in.