简体   繁体   中英

Connect to Microsoft SQL Server using R on Mac

Does anyone have a link for a good walkthrough on connecting to Microsoft SQL Server using R on a Mac ? I've been looking for awhile and can't seem to find anything that works for me.

I got it to work for me.

I had to use SQL Server driver from Simba (not the Microsoft's one) and set this parameter: Integrated Security=NTLM (I think same could have been done for Trusted Connection)

https://community.rstudio.com/t/rstudio-database-connections-using-windows-authentication/7465/32

Maybe you will find what you are looking for at the URL below.

http://www.odbcmanager.net/about.php

I have never used MAC. I don't know anything about that kind of machine.

I have never used a Mac machine in my life, but for R and SQL, I don't think it make any difference what kind of machine you are on. The following works for me.

library(RODBC)
dbconnection <- odbcDriverConnect("Driver=ODBC Driver 11 for SQL Server;Server=Server_Name\\SQLEXPRESS; Database=TestDB;Uid=; Pwd=; trusted_connection=yes")
initdata <- sqlQuery(dbconnection,paste("select * from MyTable;"))
odbcClose(channel)

RODBC odbcDriverConnect() Connection Error

https://andersspur.wordpress.com/2013/11/26/connect-r-to-sql-server-2012-and-14/

Give it a try on your side.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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