Zhixian's Tech Blog

2013-06-22

How to install FreeTDS on Ubuntu

Filed under: computing — Tags: , , , , , , , — Zhixian @ 17:47:06 pm

This post describes the steps carried out to build freetds from source files.
It then go on to describe the steps carried out to install freetds.

This is part of my “How to connect to Sql Server from Ubuntu” series of blog post.

Assumptions

  1. The version of Ubuntu used in this guide is Ubuntu 12.04.2 LTS (Precise Pangoline) 32-bit.
  2. You are trying to connect to Microsoft Sql Server 2008 or later.
  3. You know how to use a terminal session in Ubuntu.
  4. You have installed unixodbc.

Required materials

  1. freetds (as of this writing, latest version is 0.91.89)
    Database driver that would allow us to connect to Sybase/Sql Server database servers.
    (download from
    ftp://ftp.freetds.org/pub/freetds/stable/)

freetds installation steps overview

  1. Download source code for freetds. I assume you know how to do this.
  2. Extract source code out of freetds gzipped package
  3. Compile and install freetds . This involves the following steps:
    1. ./configure
    2. make
    3. make install

Extract source code out of freetds gzipped package

1) Assuming you downloaded the freetds gzip file to a directory call Downloads in your home directory, you should see something like the below in your file manager:

image

2)  Right-click on the package.
A popup menu should appear.
Select the menu item “Extract Here” to extract the contents of the package.

image

3) After the contents are extracted, you should now see a screen like the below in the file manager:

image

 

Compile freetds

1) Start a terminal session.
Navigate to the directory where you extract the freetds source files.

image

2) Configure the compilation process by typing ./configure on the command line.

image

This step checks to make sure that the system has all the required components needed to build freetds.

3) If there are no error messages in the configuration, proceed to build freetds by typing make on the command line.

image

4) Assuming the compilation succeed, you can proceed to install freetds onto your system.
You do this by typing make install on the command line.

image

If for some reason your user account do not have sufficient persmissions to install freetds, you will probably see error messages in the terminal .
This means you need to use a superuser account to install freetds.
In which case you would type sudo make install on the command line instead.

image

5. After installation, you should get a screen like the below:

image

With this, you have installed freetds into your Ubuntu system.

Advertisements

How to install unixODBC on Ubuntu

Filed under: computing — Tags: , , , , , , — Zhixian @ 14:04:06 pm

This post describes the steps carried out to build unixODBC from source files.
It then go on to describe the steps carried out to install unixODBC.

This is part of my “How to connect to Sql Server from Ubuntu” series of blog post.

Assumptions

  1. The version of Ubuntu used in this guide is Ubuntu 12.04.2 LTS (Precise Pangoline) 32-bit.
  2. You are trying to connect to Microsoft Sql Server 2008 or later.
  3. You know how to use a terminal session in Ubuntu.

Required materials

  1. unixodbc (as of this writing, latest version is 2.3.1)
    Allows unix/linux platforms to use ODBC to connect to databases
    (downloadable from http://www.unixodbc.org/download.html)

Download source vs apt-get

The apt-get utility in Ubuntu do have a version of unixODBC.
However, it is out-of-date and may not work well with later versions of Microsoft Sql Server and their corresponding database drivers.
This is especially important if you are trying to connect to later versions of Microsoft Sql Server (2005 onwards).
It is recommended that you get the the latest versions of unixODBC when working with the latest Microsoft Sql Server instead of relying on packages in apt-get.

unixodbc installation steps overview

  1. Download source code for unixodbc. (I assume you know how to do this.)
  2. Extract source code out of unixodbc gzipped package.
  3. Compile unixodbc. This involves the following steps:
    1. ./configure
    2. make
    3. make install

Extracting sourcecode out of unixodbc package

1) Assuming you download the unixodbc gzip file to a directory call Downloads in your home directory, you should see something like the below in your file manager:

image

2)  Right-click on the package.
A popup menu should appear.
Select the menu item “Extract Here” to extract the contents of the package.

image

3) After the contents of the file were extracted, you should now see something like the below in your file manager:

image

 

Compile unixodbc

1) Start a terminal session.
Navigate to the directory where you extract the unixodbc source files.

image

2) In the folder. configure the compilation process by typing ./configure on the command line.

image

The system will then check through if the system has all the required components build unixodbc.

3) If you do no see any error messages in the configuration step, you can proceed to build the unixodbc by typing make on the command line.

image

This is the step that takes the source code and compile them to make unixodbc.

4)  Assuming the compilation succeed, you can now install unixodbc into your system.
This is done by typing make install on the command line.

image

If you do not have sufficient permissions to install unixodbc into your system, you may see permission denied and error messages.
If that is the case, type sudo make install on the command line instead.

image

5)  Your final result screen should look like the below.
It would also be useful to note down the directories highlighted below.
These are folders where you will be placing your ODBC configuration.

image

 

With this, you have installed unixodbc into your Ubuntu system.

Create a free website or blog at WordPress.com.