我已freetds.conf
按如下方式设置。请注意,我已将数据库设置为 myawesomdb:
[EXAMPLE_CONF]
driver = /usr/lib64/libtdsodbc.so
host = example.org
database = myawesomedb
port = 5150
tds version = 8.0
;client charset = UTF-8
类似地,我进行了如下设置odbc.ini
:
[EXAMPLE_CONF]
Description = SQL Server 2005
Driver = FreeTDS
Database = myawesomedb
Servername = EXAMPLE_CONF
TDS_Version = 8.0
但是当我使用 tsql 连接时,它似乎忽略了我已经设置的数据库:
$ tsql -S EXAMPLE_CONF -U jordan
locale is "en_US.UTF-8"
locale charset is "UTF-8"
Password:
1> select db_name()
2> go
master
这就是我想要发生的事情:
$ tsql -S EXAMPLE_CONF -U jordan
locale is "en_US.UTF-8"
locale charset is "UTF-8"
Password:
1> select db_name()
2> go
myawesomedb
我认为我只是在配置中遗漏了一些东西?
以下是相关版本信息:
FreeTDS 版本:0.64 发布:11.el5.centos
unixODBC:版本:2.2.11 发布:7.1