RODBC MS SQL access from Ubuntu using FreeTDS

后端 未结 3 1059
情书的邮戳
情书的邮戳 2021-02-11 02:08

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 sh

3条回答
  •  心在旅途
    2021-02-11 03:06

    I don't know what is causing the error on your side. Hope this helps:

    These are my settings for RODBC 1.3-10 to connect to MSSQL Server 2012. I am also on ubuntu and this works for me. I think I installed the RODBC package from the Ubuntu repos:

    apt-cache policy r-cran-rodbc
    r-cran-rodbc:
      Installed: 1.3-10-1
      Candidate: 1.3-10-1
      Version table:
     *** 1.3-10-1 0
            500 ftp://ftp.fu-berlin.de/linux/ubuntu/ trusty/universe amd64 Packages
            100 /var/lib/dpkg/statu
    

    uname -a

    Linux xxx 3.13.0-30-generic #54-Ubuntu SMP Mon Jun 9 22:45:01 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
    

    odbc.ini

    [mydsn]
    APP = unixodbc
    Description     = master on vmXX
    Driver          = TDSdriver
    Server          = vmXX
    Database        = master
    Port            = 1433
    #Trace           = No
    #TraceFile       = /var/log/freetds/freetds--odbc.log
    TDS Version     = 7.2
    

    freetds.conf

    [global]
            # TDS protocol version
    ;       tds version = 4.2
    
            # Whether to write a TDSDUMP file for diagnostic purposes
            # (setting this to /tmp is insecure on a multi-user system)
            #dump file = /tmp/freetds.log
            #debug flags = 0xffff
    
            # Command and connection timeouts
    ;       timeout = 10
    ;       connect timeout = 10
    
            # If you get out-of-memory errors, it may mean that your client
            # is trying to allocate a huge buffer for a TEXT field.  
            # Try setting 'text size' to a more reasonable limit 
            text size = 64512
    
    
    
    
    [vmXX]
            host = 111.222.333.555
            port = 1433
            tds version = 7.2
            client charset = UTF-8
    

    Output from

    ps aux  | grep "/R"
    knb      56969 ....
    lsof -p 56969 | grep -i odbc
    
    R       56969  knb  mem    REG     8,1    72408  8528592 /usr/lib/x86_64-linux-gnu/libodbcinst.so.1.0.0
    R       56969  knb  mem    REG     8,1   400608  8521896 /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
    R       56969  knb  mem    REG     8,1   419680  8525415 /usr/lib/x86_64-linux-gnu/libodbc.so.1.0.0
    R       56969  knb  mem    REG     8,1    96845  8933205 /usr/local/lib/R/site-library/RODBC/libs/RODBC.so
    

提交回复
热议问题