GNU/Linux >> Tutoriales Linux >  >> Cent OS

Cómo instalar Microsoft SQL Server (MS SQL) en RHEL 7 (CentOS 7) / Ubuntu 16.04

Microsoft ha lanzado SQL Server para Redhat Enterprise Linux y Ubuntu , y es hora de aprovechar Microsoft SQL Server para tenerlo encima del sistema operativo Linux.

Requisitos del sistema

Asegúrese de que su sistema cumpla con los siguientes requisitos de hardware.

Sistemas operativos compatibles

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

Repositorio de configuración

### 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

Instalar Microsoft SQL Server en Linux

### CentOS 7 / RHEL 7 ###  

yum install -y mssql-server

### Ubuntu 16.04 ###

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

Configurar el servidor MS SQL.

### CentOS 7 / RHEL 7 ###  

/opt/mssql/bin/mssql-conf setup

### Ubuntu 16.04 ###

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

Mientras ejecuta la instalación, se le pedirá que elija una de las siete ediciones de SQL Server.

1) Evaluación (gratis, sin derechos de uso de producción, límite de 180 días)
2) Desarrollador (gratis, sin derechos de uso de producción)
3) Express (gratis)
4) Web (PAGO )
5) Estándar (PAGADO)
6) Enterprise (PAGADO)
7) Enterprise Core (PAGADO)
8) Compré una licencia a través de un canal de ventas minorista y tengo un clave de producto para ingresar.

Salida:

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.

Inicie el servicio MS SQL (opcional).

### 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

Instalar herramientas de MS SQL Server en Linux

Configure el repositorio de herramientas del servidor SQL.

### 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

Instale las herramientas MS SQL (sqlcmd y bcp) y el paquete de desarrollador ODBC.

### 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
Al instalar las herramientas del servidor Microsoft SQL, deberá aceptar los términos de la licencia.

Cortafuegos

Configure el cortafuegos para permitir 1433 port para que podamos acceder al servidor SQL desde máquinas externas.

CortafuegosD:

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

UFW:

sudo ufw allow 8080/tcp
sudo ufw reload

Conéctese al servidor MS SQL

sqlcmd ahora se encuentra el comando /opt/mssql-tools/bin directorio. Para hacer que el comando de herramientas esté disponible para la ruta del shell, ejecute el siguiente comando.

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

Una vez completada la instalación, conéctese al servidor MS SQL con el siguiente comando.

sqlcmd -H 127.0.0.1 -U sa

Password: 
1>

Eso es todo.


Cent OS
  1. Cómo instalar un servidor DNS en RHEL 8 / CentOS 8 Linux

  2. Cómo instalar Puppet en CentOS 8 / RHEL 8

  3. Cómo instalar Puppet 6.x en CentOS 7 / RHEL 7

  4. Cómo instalar Redis en CentOS 7/RHEL 7 y Ubuntu 18.04/Ubuntu 16.04

  5. CentOS / RHEL 7:Cómo instalar la GUI

Cómo instalar Zabbix Server 4.x en CentOS 6 / RHEL 6

Cómo instalar el servidor Zabbix 5.0/4.0 en CentOS 7/RHEL 7

Cómo instalar Microsoft SQL Server en Ubuntu 20.04 LTS

Cómo instalar Microsoft SQL Server en CentOS 7

Cómo instalar Microsoft SQL Server en CentOS 8

Cómo instalar Microsoft SQL Server en Ubuntu 16.04 LTS

    Memoria Al menos 3,25 GB
    Sistema de archivos XFS o EXT4
    Espacio en disco Mínimo 1 GB
    Tipo de procesador Solo compatible con x64