0

I'm having troubles trying to connect to a local SQL Server database on JetBrains products (DataGrip, PhpStorm...) although I'm able to connect using SQL Server Management Studio.

The server name that I'm using on SSMS looks like this : Machine-name\SQLEXPRESS.

I'm using a username and password to connect, but I'm also able to connect using my Windows account on SSMS.

The issue is that when i try to configure the connection on JetBrains products, it fails.

I put :

Host : Machine-name
Instance : SQLEXPRESS
user : username
password: password
database: database-name

At the end it gives me a url like this :

jdbc:sqlserver://Machine-name\SQLEXPRESS;database=database-name

But I get an error like this : java.net.SocketTimeoutException: Receive timed out stating "Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connection at the port. Make sure that TCP connection to the port are not blocked by a firewall...."

I think it has to do with the configuration on these products because I can successfully connect to my database using SQL Server Management Studio.

LazyOne
  • 158,824
  • 45
  • 388
  • 391
naspy971
  • 1,137
  • 2
  • 13
  • 31
  • Usually, javabased stuff doesn't do instance names. Try ip:port to connect, like: 192.168.10.1:1433 or servername:1433 – siggemannen Apr 10 '23 at 09:33
  • @siggemannen I've put the ip address but I still get the same issue unfortunately. The database is stored locally but I've got the "Machine-name\SQLEXPRESS" expression from the config automatically detected by SQL Server Management Studio; – naspy971 Apr 10 '23 at 09:53
  • It probably doen't run on default 1433 port then. Check out in the sql server configuration manager which port it uses – siggemannen Apr 10 '23 at 09:56
  • 4
    Quite likely your SQL Server is not listening on TCP (as far as I remember TCP connections are not allowed by default, at least it was in the past) and only uses Shared Memory for example. Check SQL Server config tool (not SSMS, a separate one, check your start menu items as I do not remember the name). Check this one: https://help.dugeo.com/m/Insight/l/438913-troubleshooting-enabling-tcp-ip-in-the-sql-server – LazyOne Apr 10 '23 at 10:40
  • The answer provided by @LazyOne makes sense. Speaking from our experience with MSSQL Server, it's primarily related to disabled tcp/ip connection in the config manager. The native connectors can use the built-in MSSQL protocols to connect to a SQL instance, whereas DataGrip does not. – Alexander Molchanov Apr 12 '23 at 15:41

0 Answers0