6

コマンドで remort mssql サーバーに接続しようとしているときに

tsql -S SQLEXPRESS  -U sa

passwod :sa エラー 20009 (重大度 9): 接続できません: Adaptive Server が利用できないか存在しません OS エラー 111、"接続が拒否されました" としてエラーをスローします。

私が従った手順 /etc/freetds/freetdsconf.conf

[SQLEXPRESS]
host = 192.168.1.9
port = 1433
tds version = 8.0
client charset = UTF-8

/etc/odbcinst.ini
[FreeTDS]
Description     = TDS driver (Sybase/MS SQL)
Driver          =/usr/lib/i386-linux-gnu/odbc/libtdsodbc.so
Setup           =/usr/lib/i386-linux-gnu/odbc/libtdsS.so
CPTimeout       =
CPReuse         =
FileUsage       = 1


etc/odbc.ini
[SQLEXPRESS]
Driver      = FreeTDS
Description = ODBC connection via FreeTDS
Trace       = No
Servername  = 192.168.1.9
Database    = cakephp_results
Port        = 1433
UID         = sa
PWD         = sa
ReadOnly    = No
4

1 に答える 1

1

In your odbc.ini file change 'Servername = ' to 'Server = '. Then remove the UID, PWD and ReadOnly lines from that file temporarily. You may want to remove them altogether and pass in the credentials from your application.

Then, be sure that your MSSQL DB is allowing connections through port 1433, that SQL Server is not blocking the incoming server's IP address, and that you have the correct password.

Also, if that doesn't work, review these troubleshooting instructions:

于 2013-08-27T04:40:24.067 に答える