{"id":2093,"date":"2019-01-16T23:55:50","date_gmt":"2019-01-16T20:55:50","guid":{"rendered":"http:\/\/kifarunix.com\/?p=2093"},"modified":"2024-03-11T22:03:40","modified_gmt":"2024-03-11T19:03:40","slug":"install-microsoft-sql-server-2017-on-fedora-29-centos-7","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-microsoft-sql-server-2017-on-fedora-29-centos-7\/","title":{"rendered":"Install Microsoft SQL Server 2017 on Fedora 29\/CentOS 7"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1069\" height=\"602\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/09\/install-mssql-centos-fedora.png\" alt=\"\" class=\"wp-image-18775\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/09\/install-mssql-centos-fedora.png?v=1695056849 1069w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/09\/install-mssql-centos-fedora-768x432.png?v=1695056849 768w\" sizes=\"(max-width: 1069px) 100vw, 1069px\" \/><\/figure>\n\n\n\n<p>Welcome to our guide on how to install <a href=\"https:\/\/www.microsoft.com\/en-us\/sql-server\" target=\"_blank\" rel=\"noreferrer noopener\">Microsoft SQL server<\/a> 2017 on Fedora 29\/CentOS 7.<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#installing-microsoft-sql-server-2017-on-fedora-cent-os\">Installing Microsoft SQL Server 2017 on Fedora\/CentOS<\/a><ul><li><a href=\"#prerequisites\">Prerequisites<\/a><\/li><li><a href=\"#create-ms-sql-repository\">Create MS SQL repository<\/a><\/li><li><a href=\"#install-microsoft-sql-server-2017\">Install Microsoft SQL Server 2017<\/a><\/li><li><a href=\"#setup-ms-sql-server\">Setup MS SQL server<\/a><\/li><li><a href=\"#mssql-server-service\">MSSQL Server Service<\/a><\/li><li><a href=\"#mssql-service-port\">MSSQL Service Port<\/a><\/li><li><a href=\"#open-mssql-service-port-on-firewall\">Open MSSQL Service Port on Firewall<\/a><\/li><li><a href=\"#administering-mssql-server\">Administering MSSQL Server<\/a><ul><li><a href=\"#install-ms-sql-server-command-line-management-tools\">Install MS SQL server command line management tools<\/a><\/li><li><a href=\"#connecting-to-mssql-server\">Connecting to MSSQL Server<\/a><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"installing-microsoft-sql-server-2017-on-fedora-cent-os\">Installing Microsoft SQL Server 2017 on Fedora\/CentOS<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"prerequisites\">Prerequisites<\/h3>\n\n\n\n<p>Before you can follow through, ensure that your server meets the following minimum requirements;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>At least 2GB of RAM<\/li>\n\n\n\n<li>64-bit CPU architecture<\/li>\n\n\n\n<li>At least 6GB of disk space<\/li>\n\n\n\n<li>At least 2x2GHZ CPU cores<\/li>\n\n\n\n<li>EXT4 or XFS filesystem<\/li>\n<\/ul>\n\n\n\n<p>To install MS SQL server 2017 on Fedora 29\/CentOS , you need to create the MS SQL repository on your Fedora 29\/CentOS 7 server since <code>mssql-server<\/code> package is not available on the default repos.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"create-ms-sql-repository\">Create MS SQL repository<\/h3>\n\n\n\n<p>Run the command below to install Fedora\/CentOS MS SQL repo.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wget -O \/etc\/yum.repos.d\/mssql-server-2017.repo https:\/\/packages.microsoft.com\/config\/rhel\/7\/mssql-server-2017.repo<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"install-microsoft-sql-server-2017\">Install Microsoft SQL Server 2017<\/h3>\n\n\n\n<p>Once the MS SQL repository is created, install MS SQL server.<\/p>\n\n\n\n<p>On CentOS 7, run;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">yum install mssql-server<\/pre>\n\n\n\n<p>On Fedora 29, run;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">dnf install mssql-server<\/pre>\n\n\n\n<p>You can however use <code>yum<\/code> on both.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"setup-ms-sql-server\">Setup MS SQL server<\/h3>\n\n\n\n<p>Once the installation is done, run the setup script, <code>\/opt\/mssql\/bin\/sqlservr-setup<\/code>, to setup MS SQL server system administrator (SA) password and choose your MS SQL edition. You can also choose your server edition using&nbsp;<a href=\"https:\/\/www.directdeals.com\/software\/microsoft-sql-server\" target=\"_blank\" rel=\"noreferrer noopener\">this microsoft sql server software<\/a>. Note that the Evaluation, Developer and Express editions are free-licensed. In this case, we are going to choose the Developer Edition. All the limitations have been removed on the Developer edition hence it is fully functional.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/opt\/mssql\/bin\/mssql-conf setup<\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>Choose an edition of SQL Server:\n  1) Evaluation (free, no production use rights, 180-day limit)\n  2) Developer (free, no production use rights)\n  3) Express (free)\n  4) Web (PAID)\n  5) Standard (PAID)\n  6) Enterprise (PAID)\n  7) Enterprise Core (PAID)\n  8) I bought a license through a retail sales channel and have a product key to enter.\n\nDetails about editions can be found at\nhttps:\/\/go.microsoft.com\/fwlink\/?LinkId=852748&clcid=0x409\n\nUse of PAID editions of this software requires separate licensing through a\nMicrosoft Volume Licensing program.\nBy choosing a PAID edition, you are verifying that you have the appropriate\nnumber of licenses in place to install and run this software.\n\n<strong>Enter your edition(1-8): 2<\/strong>\nThe license terms for this product can be found in\n\/usr\/share\/doc\/mssql-server or downloaded from:\nhttps:\/\/go.microsoft.com\/fwlink\/?LinkId=855862&clcid=0x409\n\nThe privacy statement can be viewed at:\nhttps:\/\/go.microsoft.com\/fwlink\/?LinkId=853010&clcid=0x409\n\n<strong>Do you accept the license terms? [Yes\/No]:yes<\/strong>\n\n<strong>Enter the SQL Server system administrator password: P@SSWORD12<\/strong>\n<strong>Confirm the SQL Server system administrator password:<\/strong> <strong>P@SSWORD12\n<\/strong>Configuring SQL Server...\n\nForceFlush is enabled for this instance. \nForceFlush feature is enabled for log durability.\nCreated symlink from \/etc\/systemd\/system\/multi-user.target.wants\/mssql-server.service to \/usr\/lib\/systemd\/system\/mssql-server.service.\nSetup has completed successfully. SQL Server is now starting.\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"mssql-server-service\">MSSQL Server Service<\/h3>\n\n\n\n<p>MS SQL setup is done. It is now running and has been automatically enabled to start on system reboot.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl status mssql-server<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code><span style=\"color: #00ff00;\">\u25cf<\/span> mssql-server.service - Microsoft SQL Server Database Engine\n   Loaded: loaded (\/usr\/lib\/systemd\/system\/mssql-server.service; enabled; vendor preset: disabled)\n   Active: <span style=\"color: #00ff00;\">active (running)<\/span> since Wed 2019-01-16 14:48:43 EST; 8min ago\n     Docs: https:\/\/docs.microsoft.com\/en-us\/sql\/linux\n Main PID: 3930 (sqlservr)\n   CGroup: \/system.slice\/mssql-server.service\n           \u251c\u25003930 \/opt\/mssql\/bin\/sqlservr\n           \u2514\u25003951 \/opt\/mssql\/bin\/sqlservr\n<\/code><\/pre>\n\n\n\n<p>The service is also enabled to run on system boot;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl is-enabled mssql-server<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>enabled<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"mssql-service-port\">MSSQL Service Port<\/h3>\n\n\n\n<p>The default port for MS SQL is 1433\/TCP.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ss -altnp | grep 1433<\/code><\/pre>\n\n\n\n<pre class=\"scroll-sz\"><code>LISTEN     0      128          *:1433                     *:*                   users:((\"sqlservr\",pid=3951,fd=133))\nLISTEN     0      128         :::1433                    :::*                   users:((\"sqlservr\",pid=3951,fd=138))\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"open-mssql-service-port-on-firewall\">Open MSSQL Service Port on Firewall<\/h3>\n\n\n\n<p>Configure firewalld to allow external access to MS SQL server.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">firewall-cmd --add-port=1433\/tcp --permanent\nfirewall-cmd --reload<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"administering-mssql-server\">Administering MSSQL Server<\/h3>\n\n\n\n<p>MS SQL has been successfully installed on Fedora 29\/CentOS 7 server.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"install-ms-sql-server-command-line-management-tools\">Install MS SQL server command line management tools<\/h4>\n\n\n\n<p>In order to manage the database tasks, you need to install MS SQL server command line management tools such as <code>bcp<\/code> and <code>sqlcmd<\/code>. These tools are not available on the default Fedora\/CentOS repos. Hence create the repository as shown below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wget -O \/etc\/yum.repos.d\/mssql-tools.repo https:\/\/packages.microsoft.com\/config\/rhel\/7\/prod.repo<\/pre>\n\n\n\n<p>Install MS SQL command line tools<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">yum install -y mssql-tools unixODBC-devel<\/pre>\n\n\n\n<p>The <code>sqlcmd<\/code> command is installed to <code>\/opt\/mssql-tools\/bin\/<\/code>. To ensure that the command is available on your default PATH environment, create a symbolic to <code>\/usr\/bin\/<\/code> as shown below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ln -s \/opt\/mssql-tools\/bin\/sqlcmd \/usr\/bin\/<\/pre>\n\n\n\n<p>The <code>sqlcmd<\/code> is now available under <code>\/usr\/bin\/<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">which sqlcmd<\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\/usr\/bin\/sqlcmd<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"connecting-to-mssql-server\">Connecting to MSSQL Server<\/h4>\n\n\n\n<p>Connect locally to you MS SQL server as SA and create a sample database;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sqlcmd -S localhost -U SA<\/pre>\n\n\n\n<p>You are prompted for password;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Password: &lt;SA password created above&gt;<\/code><\/pre>\n\n\n\n<p>Successful login takes you to sqlcmd prompt, <code>1&gt;<\/code>. Note that an sql statement is not executed until you enter <code>GO<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">1&gt; CREATE DATABASE testdbA\n2&gt; GO\n1&gt;<\/pre>\n\n\n\n<p>Verify the test database creation.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">1&gt; select name from sys.databases\n2&gt; go<\/pre>\n\n\n\n<p>If you need to learn more on MS SQL statements, look <a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/t-sql\/tutorial-writing-transact-sql-statements?view=sql-server-2017\" target=\"_blank\" rel=\"noopener\">here<\/a>. We hope this article helps.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Welcome to our guide on how to install Microsoft SQL server 2017 on Fedora 29\/CentOS 7. Installing Microsoft SQL Server 2017 on Fedora\/CentOS Prerequisites Before<\/p>\n","protected":false},"author":1,"featured_media":18774,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121,299],"tags":[7240,7241,303,7242],"class_list":["post-2093","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","category-database","tag-install-mssql-server-centos","tag-install-msssql-server-on-fedora","tag-mssql","tag-mssql-server-centos","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/2093"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=2093"}],"version-history":[{"count":6,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/2093\/revisions"}],"predecessor-version":[{"id":21094,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/2093\/revisions\/21094"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/18774"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=2093"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=2093"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=2093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}