久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

使用 FreeTDS 從 Ubuntu 訪問 RODBC MS SQL

RODBC MS SQL access from Ubuntu using FreeTDS(使用 FreeTDS 從 Ubuntu 訪問 RODBC MS SQL)
本文介紹了使用 FreeTDS 從 Ubuntu 訪問 RODBC MS SQL的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我正在嘗試從 Ubuntu 機器訪問托管在我的 Windows 機器上的 MS SQL 服務器.我有一個閃亮的應用程序,可以訪問在 Windows 上運行良好的 MSSQL.我想在 Ubuntu 上使用閃亮的服務器托管它,以便其他人可以訪問網頁并將他們的 SQL 服務器作為應用程序的輸入提供.

所有這些都可以在 Windows 上正常運行.現在我無法讓 unixODBC 工作.我想我的 odbc/freeTDS 安裝和配置是正確的.我可以使用 tsql -S 從 Ubuntu 終端連接和查詢 SQL 數據庫實例.用了一些谷歌搜索,但最終它奏效了.

現在,當我嘗試從 R 連接時,出現此錯誤.

sql <- odbcConnect("abc.xyz.com", "uname", "passwd")

<塊引用>

在odbcDriverConnect("DSN=abc.xyz.com;UID=uname;PWD=passwd"):[RODBC] 錯誤:狀態 08001,代碼 0,消息[unixODBC][FreeTDS][SQL Server]無法連接到數據源 2:在odbcDriverConnect("DSN=abc.xyz.com;UID=uname;PWD=passwd"):[RODBC] 錯誤:狀態 01000,代碼 20002,消息[unixODBC][FreeTDS][SQL Server]Adaptive Server 連接失敗 3:在odbcDriverConnect("DSN=abc.xyz.com;UID=uname;PWD=passwd"):[RODBC] 錯誤:狀態 01000,代碼 20017,消息[unixODBC][FreeTDS][SQL Server]來自服務器的意外 EOF 4:在odbcDriverConnect("DSN=abc.xyz.com;UID=uname;PWD=passwd"): ODBC 連接失敗

freeTDS.conf[abc.xyz.com]主機 = abc.xyz.com端口 = 49475tds 版本 = 8.0odbcinst.ini[免費TDS]說明 = FreeTDS unixODBC 驅動程序驅動程序 =/usr/local/lib/libtdsodbc.so設置 =/usr/local/lib/libtdsodbc.so數據庫配置文件[abc.xyz.com]描述 = 閃亮測試驅動程序 = FreeTDS跟蹤 = 否服務器 = abc.xyz.com\instance_name數據庫 = dbanme端口 = 49475

這個錯誤來自服務器的意外 EOF"對我來說并不陌生.當我嘗試使用 tsql 進行連接時,我遇到了同樣的錯誤.我能夠通過向 freeTDS.conf 添加tds version = 8.0"行來克服這個問題.不確定如何讓 RODBC 使用此配置.我讀過其他用戶可以使用 freeTDS 進行 sql-server 的帖子.不確定這里缺少什么.我也嘗試過重新安裝 RODBC.

解決方案

我解決了這個問題.odbc.ini 文件中需要 TDS 版本.

TDS_Version = 8.0

tsql 從 freeTDS.conf 讀取版本信息并工作.isql 因同樣的錯誤而失敗,它也在 odbc.ini 中尋找此配置.因此,如果您正在為 R/Python 進行配置,請使用 isql 進行測試.

I'm trying to access MS SQL server hosted on my Windows box from an Ubuntu machine. I have a shiny app that access MSSQL that works fine on Windows. I want to host this with shiny server on Ubuntu so that others can access the webpage and provide their SQL server as input to the app.

All of this works fine on Windows. Now I'm not able to get unixODBC working. I think I've got the odbc/freeTDS installation and configuration correct. I'm able to connect and query SQL DB instance from Ubuntu terminal using tsql -S . It took some googling but eventually it worked.

Now, when I try to connect from R I get this error.

sql <- odbcConnect("abc.xyz.com", "uname", "passwd")

In odbcDriverConnect("DSN=abc.xyz.com;UID=uname;PWD=passwd") : [RODBC] ERROR: state 08001, code 0, message [unixODBC][FreeTDS][SQL Server]Unable to connect to data source 2: In odbcDriverConnect("DSN=abc.xyz.com;UID=uname;PWD=passwd") : [RODBC] ERROR: state 01000, code 20002, message [unixODBC][FreeTDS][SQL Server]Adaptive Server connection failed 3: In odbcDriverConnect("DSN=abc.xyz.com;UID=uname;PWD=passwd") : [RODBC] ERROR: state 01000, code 20017, message [unixODBC][FreeTDS][SQL Server]Unexpected EOF from the server 4: In odbcDriverConnect("DSN=abc.xyz.com;UID=uname;PWD=passwd") : ODBC connection failed

freeTDS.conf
[abc.xyz.com]
        host = abc.xyz.com
        port = 49475
        tds version = 8.0

odbcinst.ini
[FreeTDS]
Description   = FreeTDS unixODBC Driver
Driver        = /usr/local/lib/libtdsodbc.so
Setup         = /usr/local/lib/libtdsodbc.so

odbc.ini
[abc.xyz.com]
Description = Shiny testing
Driver = FreeTDS
Trace = No
Server = abc.xyz.com\instance_name
Database = dbanme
port = 49475

This error "Unexpected EOF from the server" is not new to me. I got the same error when I was trying to connect using tsql. I was able to overcome this by adding "tds version = 8.0" line to freeTDS.conf. Not sure how I can get RODBC to use this config. I've read posts were other users were able to sql-server using freeTDS. Not sure what is missing here. I also tried re-installing RODBC.

解決方案

I fixed this. TDS version was needed in odbc.ini file.

TDS_Version = 8.0

tsql reads version info from freeTDS.conf and worked. isql was failing with same error and it was also looking for this config in odbc.ini. So test with isql if you are configuring for R/Python.

這篇關于使用 FreeTDS 從 Ubuntu 訪問 RODBC MS SQL的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

What SQL Server Datatype Should I Use To Store A Byte[](我應該使用什么 SQL Server 數據類型來存儲字節 [])
Interpreting type codes in sys.objects in SQL Server(解釋 SQL Server 中 sys.objects 中的類型代碼)
Typeorm .loadRelationCountAndMap returns zeros(Typeorm .loadRelationCountAndMap 返回零)
MS SQL: Should ISDATE() Return quot;1quot; when Cannot Cast as Date?(MS SQL:ISDATE() 是否應該返回“1?什么時候不能投射為日期?)
Converting the name of a day to its integer representation(將一天的名稱轉換為其整數表示)
How to convert nvarchar m/d/yy to mm/dd/yyyy in SQL Server?(如何在 SQL Server 中將 nvarchar m/d/yy 轉換為 mm/dd/yyyy?)
主站蜘蛛池模板: 日韩一区二区三区视频 | 一区二区免费 | 在线成人一区 | 免费一级毛片 | 亚洲97| 精品一二三区在线观看 | 日韩毛片在线免费观看 | 成人久久久 | 中文字幕国产第一页 | 亚洲精品乱码久久久久久按摩观 | 日韩在线 | 成人在线电影网站 | 综合第一页| 亚洲免费在线视频 | 国产精品美女久久久久久久久久久 | 成人在线免费网站 | 性欧美hd| 国产伦精品一区二区三区精品视频 | 亚洲精品电影在线观看 | 欧美综合久久久 | 2022国产精品 | 午夜精品久久久久久久星辰影院 | 日批的视频 | 欧美偷偷 | 成人在线欧美 | 久久精品久久久 | 成人国产精品久久久 | 国产第1页 | 久久久一二三区 | 99re99| 亚洲成人精品国产 | 91精品国产91久久久久久丝袜 | 91亚洲国产成人久久精品网站 | 欧美一区二区大片 | 亚洲一区 | 最新中文字幕在线 | 国产午夜精品一区二区三区四区 | 久久国产精品一区二区三区 | 亚洲电影第1页 | 精品视频一区二区 | 国产高清精品一区二区三区 |