Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-26-2015, 02:33 AM   #1
LQ Newbie
Registered: Jun 2015
Posts: 3

Rep: Reputation: Disabled
hi i want to connect mssql from my linux system .

hi guys i using redhat linux 6 system which has folling configuration settings

odbcinst -j
unixODBC 2.3.0
DRIVERS............: /usr/local/etc/odbcinst.ini
SYSTEM DATA SOURCES: /usr/local/etc/odbc.ini
FILE DATA SOURCES..: /usr/local/etc/ODBCDataSources
USER DATA SOURCES..: /root/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8

odbcinst -q -d -n "SQL Server Native Client 11.0"
[SQL Server Native Client 11.0]
Description=Microsoft SQL Server ODBC Driver V1.0 for Linux

in odbc.ini file contains
Driver=SQL Server Native Client 11.0
Description=My Sample ODBC Database Connection
Database={name of database}

in odbcinst.ini file contains
[SQL Server Native Client 11.0]
Description=Microsoft SQL Server ODBC Driver V1.0 for Linux

but when i connect to sql means th below problem arrives

[root@Freedom Desktop]# isql

* unixODBC - isql *
* Syntax *
* *
* isql DSN [UID [PWD]] [options] *
* *
* Options *
* *
* -b batch.(no prompting etc) *
* -dx delimit columns with x *
* -x0xXX delimit columns with XX, where *
* x is in hex, ie 0x09 is tab *
* -w wrap results in an HTML table *
* -c column names on first row. *
* (only used when -d) *
* -mn limit column display width to n *
* -v verbose. *
* -lx set locale to x *
* -q wrap char fields in dquotes *
* -3 Use ODBC 3 calls *
* -n Use new line processing *
* -e Use SQLExecDirect not Prepare *
* --version version *
* *
* Commands *
* *
* help - list tables *
* help table - list columns in table *
* help help - list all help options *
* *
* Examples *
* *
* isql WebDB MyID MyPWD -w < My.sql *
* *
* Each line in My.sql must contain *
* exactly 1 SQL command except for the *
* last line which must be blank (unless *
* -n option specified). *
* *
* Please visit; *
* *
* *
* *
* *

[root@Freedom Desktop]# isql -v MSSQLTest username pwd
[S1T00][unixODBC][Microsoft][ODBC Driver 11 for SQL Server]Login timeout expired
[08001][unixODBC][Microsoft][ODBC Driver 11 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.
[08001][unixODBC][Microsoft][ODBC Driver 11 for SQL Server]TCP Provider: Error code 0x2AF9
[ISQL]ERROR: Could not SQLConnect
[root@Freedom Desktop]#

pls guys hep me to solve this problem pls pls,, i really needs urgently the solution
Old 06-26-2015, 09:32 AM   #2
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,072
Blog Entries: 14

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Your error mentions "mysql". That is NOT the same thing as "mssql". MySQL is an opensource datatabase. MSSQL is a proprietary database on MS Windows (originally derived from Sybase).

I haven't tried to connect to MSSQL on Windows from Linux but doing a search yields several hits the first of which looks like it might be useful:

That suggests use of FreeTDS for talking to MSSQL. The link they have in the above post for FreeTDS isn't working but I found their main site is still active:

Be careful in your searches - the next link after the one I mention above was talking about unixODBC but clearly for mysql rather than mssql.

Last edited by MensaWater; 06-26-2015 at 09:57 AM.
Old 06-26-2015, 10:30 AM   #3
LQ 5k Club
Registered: Jan 2011
Location: Nowhere near you, thank God.
Distribution: OSX Sierra
Posts: 8,592
Blog Entries: 15

Rep: Reputation: Disabled
Here is a sample from a working host:
cat /usr/local/etc/odbcinst.ini 
[SQL Server Native Client 11.0]
Description=Microsoft SQL Server ODBC Driver V1.0 for Linux

Description=TDS driver (Sybase/MS SQL)

cat /usr/local/etc/odbc.ini
Driver = FreeTDS 
Description = MSSQL database for my nice app
# Servername corresponds to the section in freetds.conf
Database = DressingRoom
and we connect using
isql -v <dsn> <user> <pass>
and worked that out from the same link MensaWater provided.

Last edited by Habitual; 06-26-2015 at 10:33 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
MSSQL on Linux? spider99 Linux - Server 5 05-18-2010 10:23 AM
Program type out of range erro when trying to connect QT with MSSQL urup Linux - Software 1 01-30-2010 02:31 PM
PHP connect to MSSQL question leiw Programming 2 09-28-2008 10:34 AM
How to connect to mssql using c program raiux Programming 1 04-10-2008 05:21 AM
How can i connect mssql server from linux apache sachitanandpandey Linux - Software 1 10-25-2006 07:04 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:35 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration