安裝FreeTDS

 3,123 total views,  3 views today

上次發表了一篇如何在FreeBSD使用php連接到sybase之後,有人問我說怎麼裝FreeTDS,我想說這個應該不難說,所以就沒有記錄,不過既然有人問了,避免重覆一直回答。首先先進入ports目錄

[bash]cd /usr/ports/databases/freetds-devel[/bash]

然後依照慣例直接輸入

[bash]make install clean[/bash]

安裝完畢後,修改設定檔案

[bash]vi /usr/local/etc/freetds.conf[/bash]

在設定檔最後面,加入

[bash][SYBASE]

host = 192.168.1.100

port = 5000

tds version = 5.0

[/bash]

接下來就可以在shell裡面測試連接看看,如果可以連,通常php就沒問題了。

[bash][[email protected] /usr/local/etc]$ tsql -S sybase -U sa
locale is “zh_TW.Big5”
locale charset is “Big5”
Password:
Msg 4002, Level 14, State 1, Server SOLAR3, Line 0
Login failed.

Msg 20002, Level 9, State -1, Server OpenClient, Line -1
Adaptive Server connection failed
There was a problem connecting to the server
[[email protected] /usr/local/etc]$ tsql -S sybase -U sa
locale is “zh_TW.Big5”
locale charset is “Big5”
Password:
Msg 5704, Level 10, State 1, Server SOLAR3, Line 0
Changed client character set setting to ‘big5’.

1> exit [/bash]

發表迴響

%d 位部落客按了讚: