Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to connect to SQL Server with SQuirreL SQL from non domain registered Linux box?

I need to connect to a SQL 2008 R2 Server from my Linux box that's not registered in my company's domain. I'm trying to use SQuirreL SQL version 3.2.1. I downloaded Microsoft SQL Server JDBC Driver 3.0 and assigned it to SQuirreL on the Drivers tab.

Now, when I try to create an Alias on SQuirreL, I select the SQL Server driver and adjust the URL. For credentials I use my domain registered username and password.

When I try to test the connection, I always get the same error:

<"database-name">: Logon failure for user '<"domain">\<"domain-user">'.

How can I get this working? Thanks in advance!

like image 612
gtludwig Avatar asked Feb 08 '12 14:02

gtludwig


People also ask

How do I connect to SQL Server database from Linux?

Type the host name (or IP address) of the machine where your SQL Server instance is running when prompted. To connect to a named instance, use the format machinename \ instancename . To connect to a SQL Server Express instance, use the format machinename \SQLEXPRESS.


2 Answers

I got rid of Microsoft SQL Server JDBC Driver and downloaded jTDS driver. I tweaked a bit with it until I finally got a successful connection. The correct connection string was:

jdbc:jtds:sqlserver://<server_ip>:1433;databaseName=<instance_name>;domain=<domain_name> 
like image 190
gtludwig Avatar answered Sep 18 '22 15:09

gtludwig


The answer may be obsolete as I had the similar problem with SQuirrel SQL on MacOS 10.9.3 not on Linux box. The way Peter solved the problem inspired me. As the solution was not most straightforward I decided to put it here. Hope it helps someone.

  1. Download latest Microsoft JDBC Driver 4.0 for SQL Server (tar.gz package)
  2. Extract only sqljdbc4.jar from the package
  3. Copy the jar file into Squirrel SQL (Contents->Resources->Java->Lib)
  4. Now Microsoft MSSQL Server JDBC Driver is available to create Alias
  5. Connection URL: jdbc:sqlserver://SERVERNAME;databaseName=DATABASENAME
like image 22
krebalo Avatar answered Sep 18 '22 15:09

krebalo