Tôi đang cố chạy kết nối với máy chủ MSSQL từ máy chủ web Ubuntu 12.04 với FreeTDS và unixODBC.FreeTDS hoạt động, nhưng ODBC không thể kết nối
Sử dụng TSQL tôi có thể kết nối đến máy chủ với
~$ tsql -S dbs3 -U <username> -P <password>
Không vấn đề gì đó.
Khi tôi cố gắng kết nối với isql Tuy nhiên, tôi nhận được thông báo lỗi sau:
~$ isql -v database3 <username> <password>
[S1000][unixODBC][FreeTDS][SQL Server]Unable to connect to data source
[01000][unixODBC][FreeTDS][SQL Server]Unknown host machine name.
[ISQL]ERROR: Could not SQLConnect
tập tin cấu hình của tôi là như sau:
ODBC.INI
[database3]
Driver=FreeTDS
TDS_Version=8.0
Servername=dbs3
Port=1433
Database=benchmark_res
odbcinst. ini
[FreeTDS]
Description=FreeTDS v0.91
Driver=/usr/local/lib/libtdsodbc.so
Setup=/usr/local/lib/libtdsS.so
Trace=Yes
TraceFile=/tmp/freetds.log
ForceTrave=Yes
UsageCount=1
freetds.conf
# 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 = 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
# 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
[dbs3]
host = <server-ip>
port = 1433
tds version = 8.0
Tôi làm theo các hướng dẫn cài đặt 1. here và 2. here
Tại sao không ISQL kết nối đúng cách?
tôi đoán là mắc phải sai lầm là siêu rõ ràng nhưng tôi quá ngu ngốc để xem nó: D
Đó là những gì tôi đang làm. Tôi sử dụng dbs3 với tsql: tsql -S dbs3 -U -P . Sử dụng isql cách bạn đề cập đến trả về các lỗi này –
AndMim
Ok bạn đã thêm database3 vào tệp lưu trữ của mình – meda
Không, bởi vì từ sự hiểu biết của tôi, nó phải được giải quyết với IP tôi đã nhập trong freetds.conf – AndMim