ODBC drivers and connecting to mssql on linux not connecting to data source
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
ODBC drivers and connecting to mssql on linux not connecting to data source
Hi there,
I currently run a linux based web server which has ubuntu on it. After some doing i have now managed to get the odbc drivers working on my ubuntu operating system. However everytime i try and connect to this to mssql i get the following error message:
[unixODBC][FreeTDS][SQL Server]Unable to connect to data source
Does this mean that the port needs to be forwarded or that the username and password i have is incorrect? I assume this means that the driver is ok? When i try a tsql command it just seems to time out after 60 seconds
When i do a telnet on the IP address it comes back as connected, likewise when i do it for a port which i know is open. Rhe second i add in port 1433 which is the MSSQL port into the telnet i get a timeout. Does anybody know how i could debug this further i.e. trace the path to see if it is a username or password fault or indeed a lack of port forwarding issue?
I don't have access to the mssql server remotely until next week, otherwise i would have checked the username or password?
I can post odbc.ini and odbcinst.ini and FreeTDS configs as required
Many thanks,
Mark
Last edited by Sharkadder; 01-02-2016 at 02:07 PM.
Hi there,
I currently run a linux based web server which has ubuntu on it. After some doing i have now managed to get the odbc drivers working on my ubuntu operating system. However everytime i try and connect to this to mssql i get the following error message:
[unixODBC][FreeTDS][SQL Server]Unable to connect to data source
Does this mean that the port needs to be forwarded or that the username and password i have is incorrect? I assume this means that the driver is ok? When i try a tsql command it just seems to time out after 60 seconds
When i do a telnet on the IP address it comes back as connected, likewise when i do it for a port which i know is open. Rhe second i add in port 1433 which is the MSSQL port into the telnet i get a timeout. Does anybody know how i could debug this further i.e. trace the path to see if it is a username or password fault or indeed a lack of port forwarding issue?
I don't have access to the mssql server remotely until next week, otherwise i would have checked the username or password?
I can post odbc.ini and odbcinst.ini and FreeTDS configs as required
I'd start with the obvious things first...such as are you *POSITIVE* that remote database is up? Since you can telnet to the server itself, but NOT the MSSQL port...that may be the cause. From there, check your firewall rules...that port may be blocked somewhere. After that, user ID/password.
Barring any of that, you just mention that you are using Ubuntu, and say you're using MSSQL with a 'web server'...assuming you're using Apache (and not something else), what is the MSSQL role in this puzzle? If you're using PHP, you can access the database directly, without installing those drivers: http://php.net/manual/en/function.mssql-connect.php
Hi there and thank you for the reply. I have tried using the mssql_connect command with both the domain name and IP address and it says that it could not connect to the server. The remote database is definitely up as i have checked on the windows server this morning.
I have checked my freeTDS config and in it i have host, port and have set it to version 8.0:
# A typical Sybase server
[mssql]
host = **.**.**.***
port = 1433
tds version = 8.0
I think it may be a port forwarding issue as data being sent to it from another source is not currently being received either. I do use Apache and it is being used for a PHP application.
Hi there and thank you for the reply. I have tried using the mssql_connect command with both the domain name and IP address and it says that it could not connect to the server. The remote database is definitely up as i have checked on the windows server this morning.
I have checked my freeTDS config and in it i have host, port and have set it to version 8.0:
# A typical Sybase server
[mssql]
host = **.**.**.***
port = 1433
tds version = 8.0
I think it may be a port forwarding issue as data being sent to it from another source is not currently being received either. I do use Apache and it is being used for a PHP application.
I'd definitely check out the PHP option posted, then. FAR easier, and it uses the existing PHP framework, and is quite easy to test. But, a port-forwarding issue wouldn't be uncommon in this scenario, as far as a basic connectivity issue goes. For the coding, PHP sidesteps a good bit of that complexity.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.