Qadry
unixcop Admin

How to install ODBC on Ubuntu 21.04

Introduction

ODBC is an open specification for providing application developers with a predictable API with which to access Data Sources. Data Sources include SQL Servers and any Data Source with an ODBC Driver.

With the need for an open-source implementation and compatibility with other operating systems, unixODBC was born. This project also has a graphical interface that you can use but its potential is in the binaries that offer compatibility with this implementation.

Why use ODBC?

The two major advantages of choosing to code an application to the ODBC API are;

Portable Data Access Code

The ODBC API, as outlined by X/Open and ISO, is availible on all major platforms. Microsoft platforms include many enhancements to this specification; these enhancements are also supported by unixODBC

Dynamic Data Binding

This allows the user or the system administrator to easily configure an application to use any ODBC compliant data source. This is perhaps the single biggest advantage of coding an application to the ODBC API and to purchase these applications. Dyamic binding allows the end-user to pick a data source, ie an SQL Server, and use it for all data applications without having to worry about recompiling the application. 

Installing ODBC on Ubuntu 21.04

Upgrading the system completely is the first step in performing this tutorial.

So, open a terminal and run the following commands:

$ sudo apt update && sudo apt upgrade

Once the installation has been completed, all the basic tools for compiling and building packages must be installed. This can easily done with the following command:

$ sudo apt install build-essential -y

This will install all the dependencies we need to install unixODBC on Ubuntu 21.04

The next step is to download the unixODBC source code file. At the time of writing, the latest stable version is 2.3.9

$ wget ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.9.tar.gz

Then decompress the generated file and go to the unixODBC folder.

$ tar xvzf unixODBC-2.3.9.tar.gz

There you prepare the file for compilation:

$ cd unixODBC-2.3.9/
$ ./configure --prefix=/usr/local/unixODBC

Then, using the make command to create the package

$ make

And finally, install it on the system by running the following command:

$  make install

When the process is finished you can go to the /usr/local/unixODBC/bin folder and see all the binaries that have been installed.

$ cd /usr/local/unixODBC/bin/
$ ls

So unixODBC is ready for battle. You can now implement it and connect to various databases such as those made in Microsoft SQL Server.

Conclusion

So In this post, we show you how to install ODBC on Ubuntu 21.04 through a free implementation. If you use this database access API a lot, it will serve you well.. It’s a very interesting database project that can be very useful to many professionals. So in this post, I’ve shown you how to install it from the source code.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

x