{"id":14408,"date":"2025-03-12T18:35:47","date_gmt":"2025-03-12T13:05:47","guid":{"rendered":"https:\/\/www.skynats.com\/?p=14408"},"modified":"2026-03-17T14:03:51","modified_gmt":"2026-03-17T08:33:51","slug":"how-to-install-microsoft-odbc-driver-17-msodbcsql17-for-sql-server","status":"publish","type":"post","link":"https:\/\/www.skynats.com\/blog\/how-to-install-microsoft-odbc-driver-17-msodbcsql17-for-sql-server\/","title":{"rendered":"How to Install Microsoft ODBC Driver 17 (msodbcsql17) for SQL Server and unixODBC-devel on RHEL"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">If you&#8217;re working with a Red Hat Enterprise Linux (RHEL) server and need to install ODBC Driver 17 for SQL Server to establish a connection, follow the simple steps outlined below. This guide will also walk you through the installation of the unixODBC-devel package, which is often required for development purposes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-prerequisites\" style=\"font-size:18px\"><strong>Prerequisites<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>RHEL 7 or 8 system.<\/li>\n\n\n\n<li>Root or sudo privileges.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-1-download-microsoft-repository-configuration-package\" style=\"font-size:18px\"><strong>1. Download Microsoft Repository Configuration Package<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before installing the <a href=\"https:\/\/learn.microsoft.com\/\" target=\"_blank\" rel=\"noopener\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-secondary-color\">Microsoft<\/mark><\/a> ODBC Driver, we need to configure the Microsoft repository on your system. The following command will download the Microsoft repository configuration package based on your RHEL version.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -sSL -O https:\/\/packages.microsoft.com\/config\/rhel\/$(grep VERSION_ID \/etc\/os-release | cut -d '\"' -f 2 | cut -d '.' -f 1)\/packages-microsoft-prod.rpm<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This command retrieves the appropriate repository configuration for your version of RHEL.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-2-install-the-repository-configuration-package\" style=\"font-size:18px\"><strong>2. Install the Repository Configuration Package<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Once the configuration file is downloaded, install the package to configure the Microsoft repository on your RHEL server:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo yum install packages-microsoft-prod.rpm<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After installation, it&#8217;s a good practice to delete the downloaded .rpm file to keep your server clean (optional):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rm packages-microsoft-prod.rpm<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-3-remove-potential-conflicting-packages\" style=\"font-size:18px\"><strong>3. Remove Potential Conflicting Packages<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Sometimes, certain packages like unixODBC-utf16 can conflict with the installation of the necessary ODBC driver. To avoid these conflicts, you can remove the potentially problematic packages with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo yum remove unixODBC-utf16 unixODBC-utf16-devel<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-4-install-microsoft-odbc-driver-17-for-sql-server\" style=\"font-size:18px\"><strong>4. Install Microsoft ODBC Driver 17 for SQL Server<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now that your system is properly configured, you can install the ODBC Driver 17 for SQL Server using the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ACCEPT_EULA=Y yum install -y msodbcsql17<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The ACCEPT_EULA=Y flag ensures that you accept the Microsoft End User License Agreement (EULA) before installation proceeds.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-5-install-unixodbc-devel-package\" style=\"font-size:18px\"><strong>5. Install unixODBC-devel Package<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">For development purposes, if you need to access the Unix ODBC development headers, you can install the unixODBC-devel package with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo yum install -y unixODBC-devel<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This package provides development libraries and headers for working with ODBC data sources.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-6-optional-install-sqlcmd-and-bcp-tools\" style=\"font-size:18px\">6. <strong>Optional: Install SQLCMD and BCP Tools<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">If you require additional tools such as sqlcmd (SQL command-line tool) and bcp (bulk copy utility) for interacting with your SQL Server instance, you can install them by running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ACCEPT_EULA=Y yum install -y mssql-tools<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Once the tools are installed, you can add their binaries to your system\u2019s PATH by running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo 'export PATH=\"$PATH:\/opt\/mssql-tools\/bin\"' &gt;&gt; ~\/.bashrc\nsource ~\/.bashrc<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" style=\"font-size:18px\"><strong>Conclusion<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You\u2019ve now successfully configured your RHEL server with Microsoft ODBC Driver 17 (msodbcsql17) for SQL Server and the unixODBC-devel package, and optionally installed the mssql-tools and development headers. With these tools in place, you can begin working with SQL Server databases on your Linux machine, using both the command-line tools and ODBC connections in your development projects.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you need assistance to Install Microsoft ODBC Driver 17 (msodbcsql17) for SQL Server and unixODBC-devel on RHEL, feel free to <a href=\"https:\/\/www.skynats.com\/contact-us\">contact us<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re working with a Red Hat Enterprise Linux (RHEL) server and need to install ODBC Driver 17 for SQL Server to establish a connection, follow the simple steps outlined below. This guide will also walk you through the installation of the unixODBC-devel package, which is often required for development purposes. Prerequisites 1. Download Microsoft [&hellip;]<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[983],"class_list":["post-14408","post","type-post","status-publish","format-standard","hentry","category-blog","tag-microsoft-odbc-driver-17"],"_links":{"self":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/14408","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/comments?post=14408"}],"version-history":[{"count":3,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/14408\/revisions"}],"predecessor-version":[{"id":17494,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/14408\/revisions\/17494"}],"wp:attachment":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/media?parent=14408"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/categories?post=14408"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/tags?post=14408"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}