How to set the proper connection parameters to connect a SQL Server database in Atom Editor using Data-Atom package?

匆匆过客 提交于 2019-12-24 02:56:08

问题


I'm trying to use Data-Atom package in the Atom Editor to connect to a SQL Server 2012 database. I can connect to the database with SQL Server Managment Studio using Windows Authentication or SQL Server Authentication. How the data-atom-connections.cson file should be using these two authentication methods?

My data-atom-connections.cson file looks like this:

[
  {
    name: "WindowsAuthentication"
    protocol: "sqlserver"
    user: "username"
    password: "password"
    server: "apphost/Username"
    database: "master"
    options: ""
  }
{
    name: "SQLServerAuthentication"
    protocol: "sqlserver"
    user: "userlogin"
    password: "password"
    server: "apphost/sqlexpress"
    database: "master"
    options: ""
  }
]

But I get this error:

Error(ESOCKET) - Failed to connect to apphost:1433 - connect ECONNREFUSED 192.168.56.1:1433

Note: for specifying the server name I saw this post Logging In to SQL Server


回答1:


When this pull request is merged into data-atom you should have more luck.

  • Enter SERVER\INSTANCE in the server field, or SERVER\\INSTANCE if you're editing data-atom-connections.cson directly, to connect to a named instance.
  • Add the option domain=YOUR_DOMAIN to the options string to use Windows authentication (see more options for SQL Server here)
  • If you don't want to wait for the code to be merged into upstream and a new release, take it straight from my repo and place/link under ~/.atom/packages.
  • The protocol part of the URL has changed to mssql for SQL Server to align with node-mssql.


来源:https://stackoverflow.com/questions/39197644/how-to-set-the-proper-connection-parameters-to-connect-a-sql-server-database-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!