FREETDS.CONF(5)
π freetds.conf β the config file for FreeTDS (yes, THE one) π
okay bestie, so this is the manual page for freetds.conf, and it's genuinely one of those files where knowing it = power. it's LOCAL manual territory, section 5, and it's the config file for FreeTDS. let's get into it π
β¨ NAME β¨
freetds.conf β the configuration file for FreeTDS, periodt.
πΈ SYNOPSIS πΈ
So. The freetds.conf file is literally the thing that describes your Sybase and Microsoft database servers to the FreeTDS library. It's giving matchmaker.
It's built out of sections, and each section is headed by a servername, followed by a list of connection properties written as name-value pairs. The defaults live in a [global] section, like the main character of the file.
Fun little lore drop: this file supersedes the interfaces file that Sybase defines for the exact same purpose β but don't worry, the interfaces file is still supported. legacy icon behavior, we respect it π«Ά
π¦ DESCRIPTION π¦
A section begins with a servername β that's the name of the server β wrapped in square brackets. The client picks that servername at its own discretion, so go off, choose freely.
β οΈ One (1) exception, and she matters: with Sybase ASA, the servername must match the database name to be used. no cap.
Sections contain properties, one per line, in the form:
name = value
where name is the connection property you're describing. Here's the vibe check on the rules:
- Servernames and properties are not case sensitive.
- Values are case-preserving β meaning they get copied literally. literally literally.
- Comments begin with either a semicolon (
;) or a pound sign (#), and run to the end of the line. - Blank lines are ignored. (they get no attention, respectfully)
- Whitespace surrounding the
=is ignored.
π PROPERTIES π
okay this is the big one, the main event, the runway. every property, all of it:
client charsetβ the encoding of client data; this overrideslocale(1)settings.- Domain: iconv character set names
- Default:
ISO-8859-1
connect timeoutβ the number of seconds to wait for a response from a connect request.- Domain:
0toMAX_INT - Default: none
- Domain:
debug flagsβ the logging granularity, i.e. how spicy your logs get.- Domain: 32-bit integer
- Default:
0x4fff
dump fileβ specifies the location of a logfile AND turns on logging. two jobs, ate.- Domain: valid file name
- Default: none
dump file appendβ log data gets appended to the file instead of being re-written for each connection.- Domain:
yes/no - Default:
no
- Domain:
emulate little endianβ forces big endian machines to act as little endian so they can communicate with Microsoft Servers. she's method acting π- Domain:
yes/no - Default:
no
- Domain:
encryptionβ three moods:offβ disables encryptionrequestβ use it if it's available (this is the default when the tds version is greater than 7.0)requiredβ allow encrypted connections only
hostβ the name of the host the server is running on.- Domain: host name or IP address
- Default:
SYBASE
initial block sizeβ the maximum size of a protocol block.- Domain: multiple of
512 - Default:
512
- Domain: multiple of
instanceβ the name of the Microsoft SQL Server instance to connect to (this supersedesport).- Domain: instance name
- Default: none
portβ the port number that the server is listening to.- Domain: any valid port
- Default: TDS 5.0,
5000; TDS 7.0 and up,1433
tds versionβ the TDS protocol version to use.- Domain:
4.2,5.0,7.0,7.1,7.2 - Default: the
--with-tdsvervalue (5.0if unspecified)
- Domain:
text sizeβ the default value ofTEXTSIZE, in bytes.- Domain:
0to4,294,967,295 - Default:
4,294,967,295
- Domain:
timeoutβ the number of seconds to wait for a response to a query.- Domain:
0toMAX_INT - Default: none (wait forever β she's patient, she's loyal, she will literally wait for you π«Ά)
- Domain:
π¨ Do not define bothportandinstance. One implies the other. pick a lane bestie.
Also, Boolean property values may be denoted as on/off, true/false, or 1/0. mix and match, it's your world.
π₯ DEBUG FLAGS π₯
The log's granularity can be controlled with the debug flags property. Here's the whole menu, no skipping:
0x02β severe error0x04β error0x08β warning0x10β network0x20β information level 10x40β information level 20x80β function trace and info0x1000β show pid0x2000β show time0x4000β show source level info (source file and line)0x8000β thread id (not implemented). yeah. she's not implemented. it's giving unfinished business π
π§ NAMES AND LOCATIONS π§
The file is normally named /etc/freetds.conf or ${HOME}/.freetds.conf.
That name can be overridden with the FREETDSCONF environment variable. (yes, that's the actual name, all caps, no underscore between FREE and TDS, iykyk)
FreeTDS will search conf files for a servername in this exact order:
- a filename set programmatically via
dbsetifile()that is in.confformat - a filename in the environment variable
FREETDSCONFthat is in.confformat ${HOME}/.freetds.confif extant/etc/freetds/freetds.conf
And the search stops with the first file containing the servername. first come, first served, no crumbing.
If no conf file is found, FreeTDS searches for an interfaces file, in this order:
- a filename set programmatically via
dbsetifile()that is in interfaces format ${HOME}/.interfaces$SYBASE/interfaces(where$SYBASEis an environment variable)
If the requested servername is not found in any configuration file, the fallback mechanism kicks in like a backup dancer:
- attempt to convert the name to an IP address with
inet_addr(3), else - attempt to convert the name to an IP address with
gethostbyname(3), else - attempt to look up the literal name
SYBASE
she's resilient. she's trying her best. π
β ENVIRONMENT β
FREETDSCONFβ overrides the name and location of the system-wide conf fileTDSDUMPβ overrides the name and location of the FreeTDS log fileTDSDUMPCONFIGβ specifies a name and location of a file that logs the search of configuration filesTDSHOSTβ overrides thehostpropertyTDSPORTβ overrides theportpropertyTDSQUERYβ synonym forDSQUERY, the default servernameTDSVERβ overrides the version specified in thefreetds.conf
π‘ The environment variablesTDSVER,TDSDUMP,TDSPORT,TDSQUERY, andTDSHOSToverride values set by a.confor interfaces file. env vars said "i'm the main character now."
π FILES π
/etc/freetds/freetds.conf
${HOME}/.freetds.conf
two paths. that's the whole list. iconic minimalism.
π SEE ALSO π
FreeTDS User Guide β go read her, she's thorough.
π HISTORY π
.conf files first appeared with version 0.53 of FreeTDS. a little origin story, we love a glow-up β¨
and that's the page, bestie!! this was FreeTDS 1.5.20, dated May 2, 2017, and you can find it filed under FREETDS.CONF(FreeTDS 5). go config your servers, you're gonna slay π
π
π¦ where this page comes from
- arch rolling: freetds 1.5.20-1 Β· GPL-2.0-only AND LGPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms