Differences between revisions 1 and 11 (spanning 10 versions)
Revision 1 as of 2008-02-08 18:14:43
Size: 1545
Comment:
Revision 11 as of 2017-07-31 14:43:33
Size: 3421
Comment: Missing Database name in
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Keywords: How to Install unixODBC,freeTDS on Debian Linux.
Line 12: Line 14:
(Starting Debian Wheezy,Jessie)
{{{
[TDS]
Description = FreeTDS Driver for Linux & MSSQL on Win32
Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
}}}
Debian Wheezy 32bit
{{{
[TDS]
Description = FreeTDS Driver for Linux & MSSQL on Win32
Driver = /usr/lib/i386-linux-gnu/odbc/libtdsodbc.so
Setup = /usr/lib/i386-linux-gnu/odbc/libtdsS.so
}}}
(Debian squeezy or prior)
Line 31: Line 48:
TDS_Version = 8.0
Line 32: Line 50:
 * OR If you are using mssql with multiple instances and dynamic port allocation you can use the following:
{{{
[SQLServer2008]
Description = Production Server
Driver = TDS
Trace = No
Server = servername\instance_name
Database = MyDatabase [replace with your database name]
TDS_Version = 8.0
}}}
Line 62: Line 91:

== Troubleshooting ==
 *If you can not connect it is probable that your database is listening on a different port.
 *Try this:
{{{
telnet myserver 1433
}}}
 *You should see something like:
{{{
Trying 10.3.3.10...
Connected to myserver.
Escape character is '^]'.
}}}
 *type '''quit''' to exit. Replace 1433 with a port number, replace myserver with your servers name.
__ If you still get connection refused try telnet from the same machine the server is on and see if you get same answer. __

=== freetds 64bit ===
 *If you get an error message like this :
{{{
[unixODBC][Driver Manager]Can't open lib '/usr/lib/odbc/libtdsodbc.so
}}}
or
{{{
sqlalchemy.exc.DBAPIError: (Error) ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib '/usr/lib/odbc/libtdsodbc.so' : file not found (0) (SQLDriverConnect)") None None
}}}
 *You need to update your tds driver template to
{{{
/usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
}}}

Keywords: How to Install unixODBC,freeTDS on Debian Linux.

unixODBC

  • Install odbc, and mssql drivers (tdsodbc)

apt-get update
apt-get install tdsodbc unixodbc
  • Create a driver template.

vi /etc/freetds/tds.driver.template
  • Inside add :

(Starting Debian Wheezy,Jessie)

[TDS]
Description     = FreeTDS Driver for Linux & MSSQL on Win32
Driver          = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
Setup           = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so

Debian Wheezy 32bit

[TDS]
Description     = FreeTDS Driver for Linux & MSSQL on Win32
Driver          = /usr/lib/i386-linux-gnu/odbc/libtdsodbc.so
Setup           = /usr/lib/i386-linux-gnu/odbc/libtdsS.so

(Debian squeezy or prior)

[TDS]
Description     = FreeTDS Driver for Linux & MSSQL on Win32
Driver          = /usr/lib/odbc/libtdsodbc.so
Setup           = /usr/lib/odbc/libtdsS.so
  • Now dsn file:

vi /etc/freetds/tds.dsn.template
  • And inside add:

[DSN_NAME]
Description     = Descripton of you DSN connection.
Driver          = TDS
Trace           = No
Database        = DefaultDatabase [replace with your database name]
Server          = mysqlserver.inter.net [replace with your SQL server's host,ip]
Port            = 1433 [replace with the port that SQL is listening on]
TDS_Version     = 8.0
  • OR If you are using mssql with multiple instances and dynamic port allocation you can use the following:

[SQLServer2008]
Description     = Production Server
Driver          = TDS
Trace           = No
Server          = servername\instance_name
Database        = MyDatabase [replace with your database name]
TDS_Version     = 8.0
  • Now run this command to add your driver to unixodbc

odbcinst -i -d -f /etc/freetds/tds.driver.template
  • Now you add dsn. You have 2 options.
  • Add system DSN for all users

odbcinst -i -s -l -f /etc/freetds/tds.dsn.template
  • Add dsn to a user your are running a command on:

odbcinst -i -s -f /etc/freetds/tds.dsn.template
  • Now test your connection:

isql -v DSN_NAME username password
  • You should get something like

**********************************************
* unixODBC - isql                            *
**********************************************
* Syntax                                     *
*                                            *
.
.
.
more
.

Troubleshooting

  • If you can not connect it is probable that your database is listening on a different port.
  • Try this:

telnet myserver 1433

  • You should see something like:

Trying 10.3.3.10...
Connected to myserver.
Escape character is '^]'.
  • type quit to exit. Replace 1433 with a port number, replace myserver with your servers name.

If you still get connection refused try telnet from the same machine the server is on and see if you get same answer.

freetds 64bit

  • If you get an error message like this :

[unixODBC][Driver Manager]Can't open lib '/usr/lib/odbc/libtdsodbc.so

or

sqlalchemy.exc.DBAPIError: (Error) ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib '/usr/lib/odbc/libtdsodbc.so' : file not found (0) (SQLDriverConnect)") None None
  • You need to update your tds driver template to

/usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so

MyWiki: unixODBC (last edited 2017-07-31 14:43:33 by LukaszSzybalski)