Skip to Content.
Sympa Menu

freetds - [freetds] Can't connect from shell

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Rubén Ortiz <ruben.ortiz AT itnet.es>
  • To: <freetds AT lists.ibiblio.org>
  • Subject: [freetds] Can't connect from shell
  • Date: Mon, 3 Dec 2007 15:40:50 +0100

Hi



I installed freetds few days ago with yum and rpmForge repository enabled. I
have a Linux Centos and php 5 like a lot of people and mssql support is not
enabled with this distro. I find some tutorials through google and i
compiled php 5 once again following a HowtoForge tutorial. Actually if i run
a php script with phpinfo() mssql is show as “enabled”. But in trust Linux
Server can’t connect against SQL 2005.



I read a lot of documents but i need some help to setup FreeTDS and try to
connect from command line. I believe that the main files to setup are:



freetds.conf

odbcint.ini

odbc.ini



I did the test with “isql” command and “tsql” with same parameters. Any
worked.



[IM002][unixODBC][Driver Manager]Data source name not found, and no default
driver specified

[ISQL]ERROR: Could not SQLConnect



Theses is an output from Isql command. So i believe that i must have a
trobule with configuration of freetds files(freetds.conf, odbc.ini, etc). I
need a little help to try to configure properly freetds from shell and
perhaps, after all, maybe i successful connect to SQL Server from php
script.



Thanks



PD: i attach freetds.conf



Freetds.conf

------------------

[global]

# TDS protocol version

tds version = 4.2



; initial block size = 512



# uses some fixes required for some bugged MSSQL 7.0 server that

# return invalid data to big endian clients

# NOTE TDS version 7.0 or 8.0 should be used instead

; swap broken dates = no

; swap broken money = no



# 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.

# (Microsoft servers sometimes pretend TEXT columns are

# 4 GB wide!) If you have this problem, try setting

# 'text size' to a more reasonable limit

text size = 64512



# This is a Sybase hosted database server, if you are directly on the

# net you can use it to test.

[JDBC]

host = 192.138.151.39

port = 4444

tds version = 5.0



# The same server, using TDS 4.2. Used in configuration examples for the

# pool server, since the pool server supports only TDS 4.2.

[JDBC_42]

host = 192.138.151.39

port = 4444

tds version = 4.2



# The client connecting to the pool server will use this to find its

# listening socket. This entry assumes that the client is on the same

# system as the pool server.

[mypool]

host = 127.0.0.1

port = 5000

tds version = 4.2



# A typical Microsoft SQL Server 7.0 configuration

;[MyServer70]

; host = ntmachine.domain.com

; port = 1433

; tds version = 7.0



# A typical Microsoft SQL Server 2000 configuration

;[MyServer2k]

; host = ntmachine.domain.com

; port = 1433

; tds version = 8.0



# A typical Microsoft SQL Server 6.x configuration

;[MyServer65]

; host = ntmachine.domain.com

; port = 1433





Archive powered by MHonArc 2.6.24.

Top of Page