Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 设置freeTsd时遇到的问题_Php_Sql Server_Odbc_Freetds - Fatal编程技术网

Php 设置freeTsd时遇到的问题

Php 设置freeTsd时遇到的问题,php,sql-server,odbc,freetds,Php,Sql Server,Odbc,Freetds,我正试图通过运行ubuntu 14.04 LTS的虚拟机配置与MS Sql Server的连接。以下是我的配置文件: odbc.ini [scr] Driver = FreeTDS Description = Scr ServerName = scr TDS Version = 9.0 odbcinst.ini [FreeTDS] Description = FreeTDS Driver v0.91 Driver = /usr/lib/x86_64-linux-gnu/odbc/l

我正试图通过运行ubuntu 14.04 LTS的虚拟机配置与MS Sql Server的连接。以下是我的配置文件:

odbc.ini

[scr]
Driver      = FreeTDS
Description = Scr
ServerName  = scr
TDS Version = 9.0
odbcinst.ini

[FreeTDS]
Description = FreeTDS Driver v0.91
Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
fileusage=1
dontdlclose=1
UsageCount=1
freetds.conf

#   $Id: freetds.conf,v 1.12 2007/12/25 06:02:36 jklowden Exp $
#
# This file is installed by FreeTDS if no file by the same 
# name is found in the installation directory.  
#
# For information about the layout of this file and its settings, 
# see the freetds.conf manpage "man freetds.conf".  

# Global settings are overridden by those in a database
# server specific section
[global]
        # TDS protocol version
        tds version = 7.1

        # 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

# A typical Sybase server
[egServer50]
        host = symachine.domain.com
        port = 5000
        tds version = 5.0

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

# Server scr
[scr]
        host = examplentmachine.domain.com
        port = 1433
        tds version = 9.0
        client charset = UTF-8
        text size = 20971520
当我跑步时:

tsql -H scr -p 1433 -U exampleuser
它返回:

locale is "en_US.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
Msg 40532 (severity 20, state 1) from scr:
    "Cannot open server "scr" requested by the login.  The login failed."
Error 20002 (severity 9):
    Adaptive Server connection failed
There was a problem connecting to the server
运行isql命令也会返回错误: isql-v可控硅

[S1000][unixODBC][FreeTDS][SQL Server]Unable to connect to data source
[01000][unixODBC][FreeTDS][SQL Server]Adaptive Server connection failed
[ISQL]ERROR: Could not SQLConnect

有人知道发生了什么吗?

顺便说一下,当我运行tsql-C时,它说正在运行TDS 4.2版。我试着将tds版本从7.1改为8.0改为9.0,结果是一样的,所以freetsd似乎没有加载配置文件之类的东西。根据tslq-C返回的内容,配置文件的路径是正确的。