GNU/Linux >> LINUX-Kenntnisse >  >> Cent OS

So installieren Sie Microsoft SQL Server (MS SQL) auf RHEL 7 (CentOS 7) / Ubuntu 16.04

Microsoft hat SQL Server für Redhat Enterprise Linux und Ubuntu veröffentlicht , und es ist an der Zeit, die Vorteile von Microsoft SQL Server zu nutzen, um es an der Spitze des Linux-Betriebssystems zu haben.

Systemanforderungen

Stellen Sie sicher, dass Ihr System die folgenden Hardwareanforderungen erfüllt.

Speicher Mindestens 3,25 GB
Dateisystem XFS oder EXT4
Speicherplatz Mindestens 1 GB
Prozessortyp nur x64-kompatibel

Unterstützte Betriebssysteme

  • Redhat Enterprise Linux 7.5/7.4/7.3/7.2
  • Ubuntu 16.04

Setup-Repository

### CentOS 7 / RHEL 7 ###

yum -y install wget
wget https://packages.microsoft.com/config/rhel/7/mssql-server-2017.repo -O /etc/yum.repos.d/mssql-server-2017.repo

### Ubuntu 16.04 ###

sudo apt-get update
sudo apt-get install -y wget curl
wget https://packages.microsoft.com/keys/microsoft.asc
sudo apt-key add microsoft.asc
curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list  | sudo tee /etc/apt/sources.list.d/mssql-server-2017.list

Installieren Sie Microsoft SQL Server unter Linux

### CentOS 7 / RHEL 7 ###  

yum install -y mssql-server

### Ubuntu 16.04 ###

sudo apt-get update
sudo apt-get install -y mssql-server

Richten Sie den MS SQL-Server ein.

### CentOS 7 / RHEL 7 ###  

/opt/mssql/bin/mssql-conf setup

### Ubuntu 16.04 ###

sudo /opt/mssql/bin/mssql-conf setup

Beim Ausführen des Setups werden Sie aufgefordert, eine von sieben Editionen von SQL Server auszuwählen.

1) Evaluierung (kostenlos, keine Produktionsnutzungsrechte, 180-Tage-Limit)
2) Entwickler (kostenlos, keine Produktionsnutzungsrechte)
3) Express (kostenlos)
4) Web (PAID )
5) Standard (PAID)
6) Enterprise (PAID)
7) Enterprise Core (PAID)
8) Ich habe eine Lizenz über einen Einzelhandelsvertriebskanal gekauft und habe eine Produktschlüssel eingeben.

Ausgabe:

Choose an edition of SQL Server:
  1) Evaluation (free, no production use rights, 180-day limit)
  2) Developer (free, no production use rights)
  3) Express (free)
  4) Web (PAID)
  5) Standard (PAID)
  6) Enterprise (PAID)
  7) Enterprise Core (PAID)
  8) I bought a license through a retail sales channel and have a product key to enter.

Details about editions can be found at
https://go.microsoft.com/fwlink/?LinkId=852748&clcid=0x409

Use of PAID editions of this software requires separate licensing through a
Microsoft Volume Licensing program.
By choosing a PAID edition, you are verifying that you have the appropriate
number of licenses in place to install and run this software.

Enter your edition(1-8): 1 <-- Choose SQL Edition. I chose to install Evaluation
The license terms for this product can be found in
/usr/share/doc/mssql-server or downloaded from:
https://go.microsoft.com/fwlink/?LinkId=855864&clcid=0x409

The privacy statement can be viewed at:
https://go.microsoft.com/fwlink/?LinkId=853010&clcid=0x409

Do you accept the license terms? [Yes/No]:yes <-- Accept License Terms

Enter the SQL Server system administrator password: <-- Set SQL Admin Password
Confirm the SQL Server system administrator password: <-- Confirm SQL Admin Password
Configuring SQL Server...

The licensing PID was successfully processed. The new edition is [Enterprise Evaluation Edition].
ForceFlush is enabled for this instance.
ForceFlush feature is enabled for log durability.
Created symlink from /etc/systemd/system/multi-user.target.wants/mssql-server.service to /usr/lib/systemd/system/mssql-server.service.
Setup has completed successfully. SQL Server is now starting.

Starten Sie den MS SQL-Dienst (optional).

### CentOS 7 / RHEL 7 ### 

systemctl start mssql-server 
systemctl enable mssql-server

### Ubuntu 16.04 ###

sudo systemctl start mssql-server
sudo systemctl enable mssql-server

Installieren Sie MS SQL Server-Tools unter Linux

Konfigurieren Sie das SQL Server-Tools-Repository.

### CentOS 7 / RHEL 7 ###

wget https://packages.microsoft.com/config/rhel/7/prod.repo -O /etc/yum.repos.d/msprod.repo

### Ubuntu 16.04 ###

curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list

Installieren Sie die MS SQL-Tools (sqlcmd und bcp) und das ODBC-Entwicklerpaket.

### CentOS 7 / RHEL 7 ###

yum install -y mssql-tools unixODBC-devel

### Ubuntu 16.04 ###

sudo apt-get update 
sudo apt-get install -y mssql-tools unixodbc-dev
Während der Installation von Microsoft SQL Server-Tools müssen Sie die Lizenzbedingungen akzeptieren.

Firewall

Konfigurieren Sie die Firewall so, dass sie 1433 zulässt Port, damit wir von externen Rechnern auf den SQL-Server zugreifen können.

FirewallD:

firewall-cmd --permanent --add-port=1433/tcp
firewall-cmd --reload

UFW:

sudo ufw allow 8080/tcp
sudo ufw reload

Mit MS SQL-Server verbinden

sqlcmd Befehl finden Sie jetzt unter /opt/mssql-tools/bin Verzeichnis. Führen Sie den folgenden Befehl aus, um den Tools-Befehl für den Shell-Pfad verfügbar zu machen.

echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
source ~/.bash_profile

Sobald die Installation abgeschlossen ist, stellen Sie mit dem folgenden Befehl eine Verbindung zum MS SQL-Server her.

sqlcmd -H 127.0.0.1 -U sa

Password: 
1>

Das ist alles.


Cent OS
  1. So installieren Sie den DNS-Server unter RHEL 8 / CentOS 8 Linux

  2. So installieren Sie Puppet unter CentOS 8 / RHEL 8

  3. So installieren Sie Puppet 6.x auf CentOS 7 / RHEL 7

  4. So installieren Sie Redis unter CentOS 7 / RHEL 7 und Ubuntu 18.04 / Ubuntu 16.04

  5. CentOS / RHEL 7:So installieren Sie die GUI

So installieren Sie Zabbix Server 4.x unter CentOS 6 / RHEL 6

So installieren Sie Zabbix Server 5.0 / 4.0 unter CentOS 7 / RHEL 7

So installieren Sie Microsoft SQL Server auf Ubuntu 20.04 LTS

So installieren Sie Microsoft SQL Server unter CentOS 7

So installieren Sie Microsoft SQL Server unter CentOS 8

So installieren Sie Microsoft SQL Server unter Ubuntu 16.04 LTS