Getting Error while connecting to MQSQL DB - E005: Could not connect to the database.

0
I am using Mendix Studio 10.20 and downloaded the latest External Database connector in IDE.  I get this error while connecting to DB.    E005: Could not connect to the database.
asked
4 answers
1

Just a heads up, always keep the slash / at the end of the Application Root URL, or the External Database Connector won’t work.

 

externalconn.png

answered
0

There is no stacktrace , however the only popup message displays this message 

 

'Make sure your application is running locally with the latest External Database Connector module included to test connection and run queries.

 

FYI-

1.MySQL is running locally on my laptop at 3306 port

2. I have downloaded the ExternalDatabaseConnector from Markeplace in MQ Studio pro 10.20

answered
0

My app was not running locally . I ran the application and was able to connect to DB successfully. Thanks for your help !!.

answered
0

Hi,


E005: Could not connect to the database in the External Database Connector usually means the Mendix runtime cannot establish a JDBC connection to SQL Server. In most cases this is caused by the connection string or driver configuration, not by the module itself.

A few things you should check.

First, make sure the JDBC driver for SQL Server is available in your project. The External Database Connector does not include database drivers. You must download the Microsoft SQL Server JDBC driver and place the .jar file inside your project:

/userlib/

For example:

mssql-jdbc-12.x.x.jre11.jar

After adding it, restart Studio Pro and run the app again.

Second, verify the connection string format. For SQL Server it should look like this:

jdbc:sqlserver://<server>:1433;databaseName=<DB_NAME>;encrypt=true;trustServerCertificate=true

Example:

jdbc:sqlserver://localhost:1433;databaseName=TestDB;encrypt=false

Make sure the server name, port, and database name are correct.

Third, confirm that SQL Server allows TCP/IP connections. If you are connecting to a local SQL Server instance:

  • Open SQL Server Configuration Manager
  • Enable TCP/IP
  • Restart the SQL Server service

Also verify that port 1433 is reachable and not blocked by firewall rules.

Fourth, check authentication. If you are using SQL authentication, provide:

Username
Password

If Windows authentication is required, you normally need to configure the connection string differently and ensure the runtime process has the correct permissions.

Finally, try testing the same connection using another client (for example SSMS or DBeaver) with the same host, port, and credentials. If it fails there as well, the issue is outside Mendix.

In most cases this error is resolved by adding the correct SQL Server JDBC driver to /userlib and verifying the JDBC connection string.


answered