[freetds] FreeTDS 0.82 on Microsoft SUA/Interix

Chandana De Silva cdesilva at aconex.com
Sun Aug 16 19:18:56 EDT 2009


Hello All,

I am trying to run FreeTDS 0.82 on Windows 2008/SUA, and I get an error, as shown below. Hope someone can help.

Thanks
Chandana

-bash-3.2$ tsql -S localhost -U sa -P XXXXXXX
locale is "POSIX:POSIX:POSIX:POSIX:POSIX:POSIX"
locale charset is "ASCII"
Msg 20008, Level 9, State -1, Server OpenClient, Line -1
Unable to open socket
There was a problem connecting to the server

-bash-3.2$ cat .freetds.conf 
[global]
        # TDS protocol version
	tds version = 8.0

	# Whether to write a TDSDUMP file for diagnostic purposes
	# (setting this to /tmp is insecure on a multi-user system)

	# Command and connection timeouts
	timeout = 10
	connect timeout = 0
	
	# If you get out-of-memory errors, it may mean that your client
	# is trying to allocate a huge buffer for a TEXT field.  
	# Try setting 'text size' to a more reasonable limit 
	text size = 64512

        client charset = ISO-8859

[localhost]
	host = 127.0.0.1
	port = 1433
	tds version = 8.0
        client charset = ISO-8859
	dump file = /tmp/freetds.log
	debug flags = 0xffff


I configured it with;
CFLAGS="-D_ALL_SOURCE -D_REENTRANT"
CPPFLAGS="-D_ALL_SOURCE -D_REENTRANT -I/usr/local/include"
LDFLAGS="-L/usr/local/lib"

./configure --enable-msdblib --with-libiconv-prefix=/usr/local/ --with-tdsver=8.0

The compiler flags were suggested in the Interix FAQ.

I also had to edit the /usr/include/netdb.h file to add;

/* Possible values left in `h_errno'.  */
#define	NETDB_INTERNAL	-1	/* See errno.  */
#define	NETDB_SUCCESS	0	/* No problem.  */
#define	HOST_NOT_FOUND	1	/* Authoritative Answer Host not found.  */
#define	TRY_AGAIN	2	/* Non-Authoritative Host not found,
				   or SERVERFAIL.  */
#define	NO_RECOVERY	3	/* Non recoverable errors, FORMERR, REFUSED,
				   NOTIMP.  */
#define	NO_DATA		4	/* Valid name, no data record of requested
				   type.  */
#define	NO_ADDRESS	NO_DATA	/* No address, look for MX record.  */


The log file:
-bash-3.2$ cat /tmp/freetds.log 
23:15:17.759000 3563 (log.c:190):Starting log file for FreeTDS 0.82
	on 2009-08-16 23:15:17 with debug flags 0xffff.
23:15:17.760000 3563 (iconv.c:78):Using trivial iconv
23:15:17.760000 3563 (iconv.c:197):names for ISO-8859-1: ISO-8859-1
23:15:17.760000 3563 (iconv.c:197):names for UTF-8: UTF-8
23:15:17.760000 3563 (iconv.c:197):names for UCS-2LE: UCS-2LE
23:15:17.760000 3563 (iconv.c:197):names for UCS-2BE: (null)
23:15:17.760000 3563 (iconv.c:363):iconv to convert client-side data to the "ASCII" character set
23:15:17.760000 3563 (iconv.c:516):tds_iconv_info_init: converting "US-ASCII"->"UCS-2LE"
23:15:17.760000 3563 (iconv.c:516):tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE"
23:15:17.760000 3563 (net.c:210):Connecting to 127.0.0.1 port 1433 (TDS version 8.0)
23:15:17.761000 3563 (net.c:264):tds_open_socket: connect(2) returned "Operation now in progress"
23:15:17.761000 3563 (util.c:334):tdserror(0x1e5550, 0x1e5640, 20008, 80)
23:15:17.762000 3563 (util.c:368):tdserror: client library returned TDS_INT_CANCEL(2)
23:15:17.762000 3563 (util.c:389):tdserror: returning TDS_INT_CANCEL(2)
23:15:17.762000 3563 (net.c:310):tds_open_socket() failed
23:15:17.762000 3563 (mem.c:563):tds_free_all_results()



More information about the FreeTDS mailing list