Linux ODBC Connection SQL server2014

Source: Internet
Author: User
Tags odbc sql server driver odbc connection

First Pit Daddy! Because the configuration Zabbix use this, online data a meal search, a meal error, tune various parameters, still can't connect, I was speechless;

This is only a small part of the project, only to provide a successful case, did not do in-depth research, you can let the encounter of the brothers less detours;

First to download the ODBC installation package on the official website; my version unixODBC-2.3.4

http://www.unixodbc.org FreeTDS SQL Server, Sybase driver-these two are born from the same root

My version: freetds-0.91

http://www.freetds.org

Here we go.

Install under Root

1. Install UnixODBC # tar Vxzf unixodbc-2.3.4.tar.gz
# CD unixODBC-2.3.4
#./configure--prefix=/usr/local/unixodbc--enable-gui=no
# make
# make Install

2. Install FreeTDS # tar Vxzf freetds-0.91.tar.gz
# CD freetds-freetds-0.91 #./configure--prefix=/usr/local/freetds--with-unixodbc=/usr/local/unixodbc--with-tdsver =8.0
# make
# make Install

3, Configuration freetds.conf

# vi/usr/local/freetds/etc/freetds.conf

TDS version =8.0 This is sometimes to try,

Forum has a brother reported this mistake, I also reported this error, I tried is not successful, but he succeeded, there must be a reason; So the version I was using everybody popular 8.0

Add SQL Server Driver # VI/USR/LOCAL/UNIXODBC/ETC Odbcinst.ini to ODBC

# Vi/usr/local/unixodbc/etc/odbc.ini

Netstat-na | Find "LISTENING" Lookup port command is turned on

General error, first look at the log, and then do not fall on the simple problem, such as Ping does not pass Ah, do not underestimate these small problems yo, once encountered a case, a ping B can ping, b ping A can ping, then lazy, less gestures once, the result I re-installed half of the system;

Also used: Tsql–c See FreeTDS version

After no error:

[Email protected] ~]#/usr/local/freetds/bin/tsql-s sqlserver2014-p 1433-u zabbix_server

Enter the SQL Server user password later

Here's the success:


Query result case:

Welcome you to shoot bricks;

Linux ODBC Connection SQL server2014

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.