Jump to Navigation

099 - How to connect MS-SQL 2008 Express Server from Linux

1. Install ODBC Driver (FreeTDS) packages.

Download URL: http://dag.wieers.com/rpm/packages/freetds/

If your server is Linux 64bit :

* freetds-0.64-1.el5.rf.x86_64.rpm
* freetds-devel-0.64-1.el5.rf.x86_64.rpm

# rpm -ihv freetds-0.64-1.el5.rf.x86_64.rpm
# rpm -ihv freetds-devel-0.64-1.el5.rf.x86_64.rpm

2. Add an entry in  /etc/odbcinst.ini

* tds.driver.template

[FreeTDS]
Description             = MS SQL Server
Driver          = /usr/lib64/libtdsodbc.so

* After odbcinst command, the entry has been added in odbcinst.ini

# odbcinst -i -d -f tds.driver.template

3. Edit /etc/odbc.ini

* Add the following entry to odbc.ini

[MSSQL]
Driver = FreeTDS
Description = MS SQL Server
Trace = No
Server = mydomain.com\SQLEXPRESS
Port = 1433
Database = mydatabase

4. Edit /etc/freetds.conf

* Add the following entry to freetds.conf.

[MSSQL]
        host = mydomain.com
        port = 1433

5. Test to connect to MS-SQL Server

 # isql -v MSSQL <userid> <password>
+---------------------------------------+
| Connected!                           
|                                      
| sql-statement                       
| help [tablename]                     
| quit                                 
|                                      
+---------------------------------------+
SQL>

 



Main menu 2

Story | by Dr. Radut