Create C# apps using SQL Server on RHEL
In this section, you will get SQL Server 2017 on Red Hat Enterprise Linux (RHEL). After that you will install the necessary dependencies to create .NET Core apps with SQL Server.
Step 1.1 Install SQL Server
Note: To ensure optimal performance of SQL Server, your machine should have at least 4 GB of memory.
Register the Microsoft Linux repository.
curl https://packages.microsoft.com/config/rhel/7/mssql-server-2017.repo | sudo tee /etc/yum.repos.d/mssql-server-2017.repo
Install SQL Server.
sudo yum update sudo yum install mssql-server
Setup your SQL Server.
sudo /opt/mssql/bin/mssql-conf setup
Microsoft(R) SQL Server(R) Setup To abort setup at anytime, press Ctrl-C. The license terms for this product can be downloaded from http://go.microsoft.com/fwlink/?LinkId=746388 and found in /usr/share/doc/mssql-server/LICENSE.TXT. Do you accept the license terms? If so, please type YES: Please enter a password for the system administrator (SA) account: Please confirm the password for the system administrator (SA) account:
You now have SQL Server running locally on your RHEL machine! Check out the next section to continue installing prerequisites.
Step 1.2 Install .NET Core
If you already have .NET Core installed on your machine, skip this step. Install .NET Core using the following commands.
You also need to ensure that your system supports enabling software collections via the scl tool.
- Enable the .NET Core Channel. For help registering your machine to get access to the channel see Chapter 1 of the .NET Core Getting Started Guide.
subscription-manager repos --enable=rhel-7-server-dotnet-rpms
- Install scl-tools
yum install scl-utils
- Install .NET Core
yum install rh-dotnetcore20
- Enable the .NET Core software collection
scl enable rh-dotnetcore20 bash
You have successfully installed .NET Core on your RHEL machine. You now have everything you need to start writing your C# apps with SQL Server!