OSQL(1)
π OSQL(1) β the FreeTDS manual, LOCAL section, and yes bestie we're doing this
okay so welcome to osql(1), straight out of the FreeTDS manual (that's the LOCAL one, iykyk) β¨ pull up a chair, this one's short and sweet and honestly kinda iconic.
π NAME π
osql β a whole lil utility for testing your FreeTDS connections and queries π¦
β¨ SYNOPSIS β¨
osql -S dsn -U username -P password [-I ini_directory]
πΈ DESCRIPTION πΈ
so osql is a diagnostic tool that ships as part of FreeTDS π it's a Bourne shell script β yes, a script, she's humble β and what she does is check and report on your configuration files. If everything checks out OK, she invokes isql. slay.
heads up though:osqlworks only with theisqlthat comes with unixODBC. no substitutes, no swaps, periodt π
π«Ά OPTIONS π«Ά
-Sdsnβ the Data Source Name to which to connect, as known toodbc.ini. π-Uusernameβ database login name.-Ppasswordβ database password. π-Iini_dirβ override theodbc.inifile location.
π EXAMPLE π
say your odbc.ini has a section like this:
[myDSN]
servername = myserver
TDS_Version = 5.0
then you'd invoke osql as:
osql -S myDSN [...]
π¦ FILES π¦
odbc.inifreetds.conf
π NOTES π (read these fr fr)
if you can connect with osql -S servername -U user -P passwd, then your FreeTDS ODBC installation is working β
that's the vibe check and you passed.
osql guesses where unixODBC might look for its odbc.ini by examining the binary. this is not always an effective approach π if it doesn't work, you'll receive a report of candidate strings. kindly pass along the output to help improve the guessing β you're basically doing community service and we love that for you π«Ά
if osql cannot intuit your odbc.ini directory, you can force the issue with the -I option. however β and this is the important part β you're then instructing osql what to test, not where unixODBC will eventually look. so your override is therefore only as good as you are π look carefully at the error output before overriding, ngl.
if you have suggestions for ways to make osql more useful as a diagnostic tool, please post them to the FreeTDS mailing list π main character energy, honestly.
β HISTORY β
osql first appeared in FreeTDS 0.65. a legend from day one π
π AUTHORS π
the osql utility was written by James K. Lowdon. wait, no β James K. Lowden. thank you James π
and that's the whole page, bestie ππ this one's FreeTDS 1.5.20, dated April 26, 2012 β go forth, connect, and slay your odbc.ini β¨π¦
π¦ 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