OS Capitan freetds.conf目录问题

时间:2017-01-27 00:40:54

标签: sql-server macos tsql osx-elcapitan freetds

我正在尝试从 OS Capitan的控制台连接SQL Server,我使用brew install homebrew/versions/freetds091安装了 FreeTDS 并编辑了文件/usr/local/Cellar/freetds091/0.91.112/etc

# A typical Microsoft server
[egServer70]
host = myhost.domain.com 
port = 1433
tds version = 7.0

然后,当我尝试连接with tsql -S myhost.domain.com -U user -P password时,我收到以下错误:

locale is "C/UTF-8/C/C/C/C"
locale charset is "UTF-8"
using default charset "UTF-8"
75Error 20009 (severity 9):   Unable to connect: Adaptive Server is unavailable or does not exist     OS error 60, "Operation timed out"
There was a problem connecting to the server

当我执行tsql -C时,我得到:

Compile-time settings (established with the "configure" script)
                        Version: freetds v0.91
         freetds.conf directory: /usr/local/php5/etc
 MS db-lib source compatibility: yes
    Sybase binary compatibility: no
                  Thread safety: yes
                  iconv library: yes
                    TDS version: 5.0
                          iODBC: no
                       unixodbc: no
          SSPI "trusted" logins: no
                       Kerberos: no

但/ usr / local / php5 / etc中没有freetds.conf文件,¿有没有办法改变到freetds.conf文件的路由?我尝试使用brew uninstall freetds卸载 FreeTDS 但是当我输入tsql -C时,我仍然有相同的响应。

我检查了我的phpinfo(),也许这就产生了冲突

enter image description here

1 个答案:

答案 0 :(得分:2)

有几种方法可以做到这一点,但最简单的方法是在主目录中放置.freetds.conf。在Mac上,这是/Users/username/.freetds.conf

如果系统范围配置存在,将在之前读取。参考:http://www.freetds.org/userguide/freetdsconf.htm