Hello Pedro,
Take a look at the following:
https://docs.mendix.com/refguide/custom-settings#4-database-settings
You will have to do custom settings so that after you publish the application, it is connected to your external database.
The settings configuration that is used locally is not used when you publish the application → that’s how multiple devs can have their own settings of the database and have no effect on the deployed application.
Hope this helps