简体   繁体   English

无法在 Linux 上使用 ODBC 驱动程序连接 SQL Server

[英]Unable to connect SQL Server with ODBC drivers on linux

I have install the driver odbc 2.3.0 on linux by this reference: https://www.microsoft.com/en-ca/download/confirmation.aspx?id=28160我已通过此参考在 linux 上安装驱动程序 odbc 2.3.0: https : //www.microsoft.com/en-ca/download/confirmation.aspx? id =28160

All these steps work correctly.所有这些步骤都可以正常工作。

This is my configation:这是我的配置:

SERVER:服务器:

  • Oracle server is on linux Oracle 服务器在 linux 上
  • SQL Server is on windows SQL Server 在 Windows 上

SQL Server: SQL 服务器:

My login and password are the same.我的登录名和密码是一样的。 It's: demo它是:演示
When I use cmd and I use the command: "ipconfig", I can get my IP当我使用cmd并使用命令:“ipconfig”时,我可以获得我的IP
My IP is: 192.168.0.106我的IP是:192.168.0.106

This is how I do my connection manually and it work:这就是我手动连接的方式,它可以工作:

手动连接

After the installation, i have configure my files odbinst.ini and odbc.ini安装后,我已经配置了我的文件 odbinst.ini 和 odbc.ini

This is my file odbcinst.ini:这是我的文件 odbcinst.ini:

odbcinst.ini

This is my file odbc.ini:这是我的文件 odbc.ini:

数据库配置文件

This is where my driver is download:这是我的驱动程序下载的地方:

在此处输入图片说明

My instance name is MSSQLSERVER and TCP-IP and listen all are enable:我的实例名称是 MSSQLSERVER 和 TCP-IP 并且监听所有都启用:

Instance-name, tcp-ip 和 listen all

Dynamic port is blank and static port is 1433:动态端口为空,静态端口为 1433:

动态端口

As you see, I can be connect on localhost with the command line:如您所见,我可以使用命令行连接到本地主机:

sqlcmd -S 192.168.0.106 -d demo -U demo -P demo 

命令行连接

But, I can't connect with my Oracle server on putty with this command line:但是,我无法使用以下命令行在 putty 上连接我的 Oracle 服务器:

isql MSSQLSERVER -v

服务器命令行

Why it don't work?为什么它不起作用?

  • The server is start服务器已启动
  • Allows remotely connexion is enable允许远程连接启用
  • I have add port 1433 in firewall setting我在防火墙设置中添加了端口 1433
  • I tried to disable the firewall, nothing change我试图禁用防火墙,没有任何改变

Something is wrong in my configuration?我的配置有问题吗?

Problem reseolve :问题解决:

Change sqlServer Localhost to SqlServer.将 sqlServer 本地主机更改为 SqlServer。

You can't connect 2 server if they are on localhost.如果它们在本地主机上,则无法连接 2 个服务器。 You need an oracle SQL Server and SQlServer working not on LocalHost您需要一个不在 LocalHost 上工作的 oracle SQL Server 和 SQlServer

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM