You need to add to your project the module connector database available on the marketplace (https://marketplace.mendix.com/link/component/2888) and check it with the database information (URL, USER, PASSWORD) data you want to use. Then build your logic with microflows to access the data.
This is typically done with the Database Connector:
https://docs.mendix.com/appstore/connectors/database-connector
https://marketplace.mendix.com/link/component/2888