我需要从Linux服务器(运行SUSE Linux 12)上的R(R版本3.4.0(2017-04-21))访问Microsoft SQL Server 2012上的数据库,并且我决定使用ODBC方法,因为我已经使用不同的数据库成功完成了该任务。我安装了适当的ODBC驱动程序,现在我正尝试像这样打开连接:
library(RODBC)
dbhandle = odbcDriverConnect("driver={ODBC Driver 17 for SQL Server};server=<server address>,1433;database=<db name>;uid=<my username>;pwd=<my password>")
但是,当我运行上面的代码片段时,我收到以下错误消息
Warning messages:
1: In odbcDriverConnect(...) :
[RODBC] ERROR: state HYT00, code 0, message [Microsoft][ODBC Driver 17 for SQL Server]
Login timeout expired
2: In odbcDriverConnect(...) :
[RODBC] ERROR: state 08001, code 258, message [Microsoft][ODBC Driver 17 for SQL Server]
TCP Provider: Error code 0x102
3: In odbcDriverConnect(...) :
[RODBC] ERROR: state 08001, code 258, message [Microsoft][ODBC Driver 17 for SQL Server]
A network-related or instance-specific error has occurred while establishing a
connection to SQL Server. Server is not found or not accessible. Check if instance name
is correct and if SQL Server is configured to allow remote connections. For more
information see SQL Server Books Online.
4: In odbcDriverConnect(...) :
ODBC connection failed
我做了很多挖掘工作,尤其是在TCP错误代码0x102上,但是我可以排除大多数列出的可能原因(TCP / IP配置,防火墙,远程访问都可以)。 / p>
我错过了一些明显的东西吗?