我有一台 LAMP 服务器(Ubuntu 12.04、Apache/2.2.22、MySQL 5.5.24、PHP 5.3.10)。但是,我还想使用 Apache 和 PHP 连接到其他机器上的其他 MsSQL 服务器,其凭据为:
Server name: HENYO-GP-TEST\HENYO_GPTEST
IP: 192.168.1.36
Username: someuser
Password: somepass
Database: somedb
我已经使用'apt-get install freetds-common freetds-bin unixodbc php5-sybase'安装了FreeDTS,然后通过'vim /etc/freetds/freetds.conf'对其进行配置,然后像这样编辑底部
# A typical Microsoft server
[192.168.1.36]
host = 192.168.1.36
port = 1433
tds version = 8.0
但是在使用'tsql -S 192.168.1.36 -U someuser -P somepass -D somedb'进行测试时,出现以下错误。
locale is "en_PH.UTF-8"
locale charset is "UTF-8"
using default charset is "UTF-8"
Default database being set to FAC
Error 20009 (severity 9):
Unable to connect: Adaptive Server is unavailable or does not exist
OS error 111, "Connection refused"
There was a problem connecting to the server
但我知道服务器已打开,因为我可以 ping 它。
是否可以使用 LAMP 连接到 MSSQL 服务器(位于其他机器上)?如果有可能?我在安装和配置上有什么错误?提前致谢。