Look at https://docs.mendix.com/refguide/published-odata-services for details on how to expose your data via OData.
Direct access to the database is prohibited.
You could try odata access to access your data from excel or other tool.
An option is the OQL-module from the appstore to create queries on the database. We have extended this module with GUI for saved query's with parameters. We export results to Excel. This is for query only, but is dynamic and direct on database. In a Data set you can write your OQL-queries with some syntax and join support of the modeller.