Freetds Download Unix For Mac

  1. Download Unix For Mac
  2. Freetds Download Unix For Mac Os X
  3. Unix

Changed in version 2.1.2: Version of FreeTDS Linux static libraries bundled with pymssql is 0.95.81 obtained from branch Branch-0_95 of the official Git repository. Up to 2.1.1 the version of FreeTDS bundled was 0.91. FreeTDS is a set of libraries that, when combined with the UnixODBC driver, allows your Linux server and applications to natively talk to a Microsoft SQL Server. Freetds for windows x64 free download. MinGW-w64 - for 32 and 64 bit Windows The mingw-w64 project is a complete runtime environment for gcc to support binaries native to Window.

Introduction¶

CentOS, Redhat Enterprise Linux (RHEL), and Mac OS X do not include adatabase connector for Microsoft SQL Server (MSSQL) that web applications andprogramming languages can use to interact with the data source. Most Windowsoperating systems already include a connector. This article covers thespecific implementation of FreeTDS as an ODBC connector to Microsoft SQLServer on CentOS/RHEL for Lasso 9, but the concepts should apply to any UNIX-based operating system and web programming language.

Prerequisites¶

It is assumed you have already set up Microsoft SQL Server 2005 or later, itsdatabases and tables, and a user that Lasso will use to connect to SQL Server.

When we configure FreeTDS, we will use an 'ODBC-combined' configuration.Read more about ODBC and FreeTDS background and terminology.

Install and configure the EPEL repository¶

Extra Packages for Enterprise Linux (or EPEL) is a Fedora Special InterestGroup that creates, maintains, and manages a high quality set of additionalpackages for Enterprise Linux, including, but not limited to, Red HatEnterprise Linux (RHEL), CentOS, Scientific Linux (SL), and Oracle EnterpriseLinux (OEL).

EPEL has an 'epel-release' package that includes GPG keys for package signingand repository information.

Note

For more information, see: https://fedoraproject.org/wiki/EPEL

It's a very good practice to verify the authenticity of packages you install.

Compare the result to the EPEL-6 key,reproduced below for convenience.

Verify that the EPEL repo is configured properly for yum. Your repos shouldend up like the following.

Download Unix For Mac

Install freetds¶

Freetds Download Unix For Mac

Verify that freetds has been built with the correct settings.

Configure freetds¶

Documentation of settings for freetds.conf.

Edit /etc/freetds.conf.

Edit /etc/odbc.ini

Freetds Download Unix For Mac Os X

Freetds Download Unix For Mac

See documentation Connection attributes that may appear in odbc.ini.

Test the freetds configuration¶

Troubleshooting¶

  • More Troubleshooting

Add the ODBC datasource in Lasso Admin¶

If you do not see the ODBC or SQLServer datasource option after installingthe freetds library, you must restart the Lasso Instance.

The Lasso Guide for 'SQL Server Data Sources'may be helpful, but note that it is written primarily for Windows users whohave the MSSQL Server libraries already installed, so the instructions maydiffer from what works on UNIX-based systems as described below.

Open the URL: http://www.myserver.com/lasso9/Admin/ds

Click ODBC.

Freetds download unix for mac os x

Click Add host.

Enter the following values.

Click the Add Host button. The user interface is very misleading and it cansometimes take up to 2 or 3 minutes for a host to be added. You should seeeither a javascript alert if there is a failure, else if successful the pageshould refresh and display the host. Expand the host to show a list ofdatabases or views for MSSQL.

Did you like this article? Please send me a Gratipay, as little as 25¢ per week!

Updates, suggestions and comments regarding this article may be sent to StevePiercy, [email protected] or comment using Disqus.

Written by Steve Piercyin Lasso on Wed, Aug 20, 2014.
Last modified: Wed, Aug 20, 2014
Tags: FreeTDS, ODBC, Microsoft SQL Server, MSSQL, CentOS, RHEL, Lasso

Welcome to the django-pyodbc wiki!

Below are instructions for setting up a Mac to connect to a MS SQL Server database.

Summary

I'm using a Mac on Yosemite Version 10.10.1 trying to connect to a MS SQL Server database. I searched and couldn't find an updated detailed answer so here's a writeup that is mostly from this amazing article here. I'm adding it on stackoverflow in case the link dies. The idea is that we'll have the following layers to setup/connect.

Layers

  • PART 1 - pyodbc
  • PART 2 - freeTDS (can check with tsql)
  • PART 3 - unixODBC (can check with isql)
  • PART 4 - MS SQL (can check with a regular python program)

Steps

  1. Install Homebrew from here - this is a package manager for Mac OSX. The article shows how to use another package manager 'MacPorts'. For my instructions, they're with homebrew. Basically homebrew has a folder 'cellar' that holds different versions of packages. Instead of modifying your normal files, it instead points to these homebrew packages.

  2. We need to install Pyodbc:

  3. Install FreeTDS with brew install freetds --with-unixodbc (FreeTDS is the driver that sits between the Mac ODBC and MS SQL Server, this chart here shows which version of TDS you should be using based on your specific Microsoft Server version; e.g. tds protocol 7.2 for Microsoft SQL Server 2008).

  4. Configure freetds.conf file (The file should be in '/usr/local/etc/freetds.conf', which for Homebrew is a link to say '/usr/local/Cellar/freetds/0.91_2/etc', but yours might be somewhere different depending on version). I edited the global and added my database info to the end (for some reason 'tds version = 7.2' would throw an error, but still work, while 8.0 just works):

  5. Verify FreeTDS installed correctly with: tsql -S myserver -U myuser -P mypassword (you should see a prompt like this if it worked)

  6. Install unixODBC with brew install unixodbc.

  7. Setup your unixODBC config files, which includes odbcinst.ini (driver configuration), and odbc.ini (DSN configuration file). By default, my files were in: /Library/ODBC (Note: NOT my user library aka /Users/williamliu/Library). Or they could also be in your homebrew installation directory /usr/local/Cellar/unixodbc/<version>/etc.

  8. Open up your 'odbcinst.ini' file and then add the following (Note: Different if you use MacPorts. For Homebrew, this file is a link to the homebrew version e.g. mine is in '/usr/local/Cellar/freetds/0.91_2/lib/libtdsodbc.so'):

  9. Open up your 'odbc.ini' and then add the following (this is usually along with odbcinst.ini:

  10. Verify unixODBC installed correctly with: isql MYSERVER MYUSER MYPASSWORD. If you get an error that you cannot connect, then add -v to check what the verbose output is and fix it. Otherwise, you should see this:

  11. Now verify pyodbc works with a python program. Run python in the shell or a .py file with this and you should get your query back:

Unix

You can refer to the documentation of pyodbc to get more help after this.