码迷,mamicode.com
首页 > 数据库 > 详细

Datagrip连接SQLServer Connecting DataGrip to MS SQL Server

时间:2018-05-02 15:55:57      阅读:515      评论:0      收藏:0      [点我收藏+]

标签:.com   rod   cte   star   you   option   team   href   UI   

Connecting DataGrip to MS SQL Server

Posted on June 21, 2016 by Maksim Sobolevskiy

Some specific needs of SQL developers like connecting to SQL Server from OSX and even using Windows authentication can be covered by DataGrip. Since releasing DataGrip, we’ve received lots of comments about connecting to SQL Server. It appears it’s not straightforward as with other databases, requiring a couple of extra steps beforehand. Here is a small guide describing the main problems you may face and how to solve them.

First, ensure that important options in SQL Server Configuration Manager are configured correctly. Make sure the SQL Server Browser is running:

技术分享图片

TCP/IP connections need to be enabled:

技术分享图片

To know the port for the connection just click on TCP/IP. In our case, it’s default port 1433.

技术分享图片

If you end up changing anything, restart the server. For most situations, this will resolve connection problems, your server will accept remote connections and you are ready to go. If you still have problems, it could be that TCP port needs to be adjusted or the remote connection to SQL server needs to be enabled in its settings. This tutorial will walk you through it, but we’ll also describe the process here.

Invoke Database View by pressing Alt/Cmd+1 and create a new data source with the appropriate driver. If you use a Microsoft driver, note that it supports SQL Server 2008 and later versions. Here we’ll assume it’s the jTds driver.

技术分享图片

If you have no driver, download it by clicking the link.

技术分享图片

Then enter the host name, the instance name and the credentials. Remember that DataGrip offers completion for host, instance and database names (Ctrl/Cmd+Space), but the name of the database is optional. For those who are used to the SSMS interface, let’s compare the connection windows.

技术分享图片

If the port number conflicts with the instance name, in the jTds driver, the instance name will take precedence over the port number, while the opposite will happen in the Microsoft driver. To avoid confusion, simply remove the port number. If you strongly wish to specify the port number, click the Auto-set button (located to the right of the Instance field) to have the port number set automatically. But remember that the port number can be changed in case you restart the server.

技术分享图片

If you need to use Windows authentication, only Microsoft driver will let you do it.

技术分享图片

The other way to connect to the server with Windows authentication is to use domain authentication of jTds driver, which lets you connect from any other machine. What is notable, it works on any OS. To do this, go to the Advanced tab of data source properties, set USENTLMV2 to true and specify the domain name in the DOMAIN field.

技术分享图片

Then enter your Windows credentials in user/password fields and click Test Connection.

If you want to check which particular databases or schemas are shown in the database view, go to the Schemas tab in Data source properties:

技术分享图片

In case you are already using DataGrip 2016.2 EAP, use More Schemas… in the database view:

技术分享图片

All selected databases will appear in the database view. This is how it looks in SQL Server Management Studio:

技术分享图片

And here’s how it looks in DataGrip:

技术分享图片

That’s it! If you are experiencing any other problems, please tweet @ us or create an issue in our youtrack.

Your DataGrip Team

The Drive to Develop

Datagrip连接SQLServer Connecting DataGrip to MS SQL Server

标签:.com   rod   cte   star   you   option   team   href   UI   

原文地址:https://www.cnblogs.com/dupeng0811/p/connecting-datagrip-to-ms-sql-server.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!