I'm trying to connect to an Azure SQL database using Datagrip (I'm on Linux) but am receiving a connection error. I tried installing Microsoft SQL Server Management Studio (SMSS) on a Windows machine and it worked fine.
This is a screenshot of the SMSS connection properties:
And here is a screenshot of the Datagrip connection properties:
Any idea what I am doing wrong here?
This error is caused if the Server name from the connection string does not match with the server name in the TLS certificate while validating.
When encrypt is set to true and trustServerCertificate
is set to false, JDBC driver will validate the TLS certificate to ensure it is connecting to the correct server.
When ‘trustServerCertificate’ is set to true, JDBC driver will not validate in TLS certificate.
Search for ‘trustServerCertificate’ and set it to “true”.
jdbc:sqlserver://{your_servername}.database.windows.net:1433;database={your_databasename};user={your_username}@{your_servername};password={your_password_here};encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;