Quantcast
Channel: CodeSection,代码区,Linux操作系统:Ubuntu_Centos_Debian - CodeSec
Viewing all articles
Browse latest Browse all 11063

How to run SQL Server v.Next Public Preview on Fedora

$
0
0

No, this headline is not a joke! A decade ago, you probably wouldn’t think of Microsoft when you hear linux or open source . Just this week, though, Microsoft introduceda public preview of one of their top products, SQL Server, for Linux. The SQL Server v.Next Public Preview is available for freedownload now. This article shows you how to run it on Fedora 25, whichis due to release next week.

Of course, Fedoraalready offersseveral full-featured, free and open source relational SQL databases. Both mariadb , a recent fork of mysql with activecommunity development, and postgresql arepopular worldwide. They’re known for ease of use, features, and stability. But SQL Server has many users as well. This is one more way those users can trynew features using Fedora.

This process uses packagesMicrosoft provides for Red Hat Enterprise Linux 7. These packages seem to work fine so far in testing on Fedora 25 as well.However,it’s apreviewrelease,so the usual caveats apply.

Note for existing database servers

To avoid any software conflict, you need to remove the unixODBC package Fedora provides by default.To remove unixODBC , run this command:

sudo dnf remove unixODBC

Be aware this package isrequired by some other database servers like mariadb . Maybe you don’t wantto remove those database server packages, though. No problem― make a virtual guest machine, and run therest of this process onthe guest.

Installing SQL Server v.Next Public Preview

First install the repository definition files:

sudo su - curl https://packages.microsoft.com/config/rhel/7/mssql-server.repo > /etc/yum.repos.d/mssql-server.repo curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/msprod.repo exit

Next, install the Microsoft SQL Server v.Next Public Preview packages using dnf:

sudo dnf -y install mssql-server mssql-tools

Open the default port on your firewall:

sudo firewall-cmd --zone=public --add-port=1433/tcp --permanent sudo firewall-cmd --reload

Next, run the setup helper for SQL Server. This lets you add a system administrator (SA) password. Do not start the service when prompted.

sudo /opt/mssql/bin/sqlservr-setup

Finally, start the SQL Server service unitsusing systemd:

sudo systemctl start mssql-server mssql-server-telemetry

Optionally, you canenable them for startup at boot time:

sudo systemctl enable mssql-server mssql-server-telemetry Testing the installation

To test the server is working properly, use the tools installed earlier. The mssql-tools package provides the sqlcmd utility for connecting to the SQL Server. Use thiscommand on the boxwhere you installed both the server and tools:

sqlcmd -S localhost -U SA

You’ll need to provide the system administrator password you set up earlier.

A prompt 1> appears for you to send SQL commands to the server. Here is an example of a command to list the installed system databases. You need to enter both lines. The GO command tells the server to process the previous line.

SELECT Name from sys.Databases; GO

You should see an output like this:

Name -------------------------------------------------------------------------------------------------------------------------------- master tempdb model msdb (4 rows affected)

To quit the sqlcmd session, enter the single command QUIT.

For more information on the SQL Server v.Next Public Preview for Linux, visit the official website .

Featured image contains Database icon by Nancy from the Noun Project


Viewing all articles
Browse latest Browse all 11063

Trending Articles