2015-10-26 36 views
8

私はUbuntuからMSSQLサーバーに接続しようとしています。私はhereのようなフリーセットをインストールしました。しかしfreetdsをLinuxにインストールするには?

enter image description here

、私は/etc/odbc.ini設定と場所/usr/local/freetds/lib/libtdsodbc.soで、私は何のドライバを持っていないドライバのパスを入力してみてください。

enter image description here

誰かがFreeTDSのをインストールし、それを使用するには、ODBC構成するために私を助けることができますか? * edit1:libtdsodbc.soが/ usr/lib/x86_64-linux-gnu/odbcにあります。私はそのドライバー/パスを使うべきですか?

+0

私がここに従っているステップを確認して、あなたを助けてくれることを願っています:http://stackoverflow.com/questions/34725523/working-with-nodejs-mssql-at-linux-ubuntu –

答えて

7

私はここで完全な設置例があるベイグラントボックス作成しました:https://github.com/FlipperPA/django-python3-vagrant/

を...しかし、ここでの基本的な手順は次のとおりです。 /etc/odbcinst.iniでドライバーにODBCINST.INI

# Install pre-requesite packages 
sudo apt-get install unixodbc unixodbc-dev freetds-dev freetds-bin tdsodbc 

ポイント:

[FreeTDS] 
Description = v0.91 with protocol v7.2 
Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so 

のodbc.iniであなたのDSNを作成します。

[dbserverdsn] 
Driver = FreeTDS 
Server = dbserver.domain.com 
Port = 1433 
TDS_Version = 7.2 

...とあなたのDSNをfreetds.conf:

[global] 
    # TDS protocol version, use: 
    # 7.3 for SQL Server 2008 or greater (tested through 2014) 
    # 7.2 for SQL Server 2005 
    # 7.1 for SQL Server 2000 
    # 7.0 for SQL Server 7 
    tds version = 7.2 
    port = 1433 

    # 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 Microsoft server 
[dbserverdsn] 
    host = dbserver.domain.com 
    port = 1433 
    tds version = 7.2 

tsql(FreeTDSレイヤーをテストする)とisql(UnixODBCからFreeTDSスタック)に接続しようとすると、接続をテストできます。

+2

私はこれで新しいです。私は私のサーバのIPを使って 'Server = dbserver.domain.com'を変更すると思いますか?これはtsql 'tsql -S dbserverdsn'を使用する方法ですか?またはIPをそこに書き込むべきですか? 'tsql -S dbserverdsn'を使用すると、エラー100(重大度11):認識されないmsgno エラー20009(重大度9):接続できません:Adaptive Serverが使用できないか、存在しません。 \t OSエラー111、 "サーバーに接続する際に問題がありました。" –

+0

tsql -S dbserverdsn

+2

tdsのバージョンを 'tsql -C'でチェックし、4.2であることがわかりました。上記の7.2を4.2に置き換えました。これは 'msgnoエラー'を取り除いたようです。 –

関連する問題