Microsoft telah merilis SQL Server untuk Redhat Enterprise Linux dan Ubuntu , dan inilah saatnya untuk memanfaatkan Microsoft SQL Server untuk menempatkannya di atas sistem operasi Linux.
Persyaratan Sistem
Pastikan sistem Anda memenuhi persyaratan perangkat keras di bawah ini.
Memori | Minimal 3,25 GB |
Sistem File | XFS atau EXT4 |
Ruang disk | Minimal 1 GB |
Jenis prosesor | hanya kompatibel dengan x64 |
Sistem Operasi yang Didukung
- Redhat Enterprise Linux 7.5/7.4/7.3/7.2
- Ubuntu 16.04
Setup Repositori
### 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
Instal Microsoft SQL Server di Linux
### CentOS 7 / RHEL 7 ### yum install -y mssql-server ### Ubuntu 16.04 ### sudo apt-get update sudo apt-get install -y mssql-server
Siapkan server MS SQL.
### CentOS 7 / RHEL 7 ### /opt/mssql/bin/mssql-conf setup ### Ubuntu 16.04 ### sudo /opt/mssql/bin/mssql-conf setup
Saat menjalankan penyiapan, Anda akan diminta untuk memilih satu dari tujuh edisi SQL Server.
1) Evaluasi (gratis, tidak ada hak penggunaan produksi, batas 180 hari)
2) Pengembang (gratis, tidak ada hak penggunaan produksi)
3) Ekspres (gratis)
4) Web (BERBAYAR )
5) Standar (PAID)
6) Perusahaan (PAID)
7) Enterprise Core (PAID)
8) Saya membeli lisensi melalui saluran penjualan eceran dan memiliki kunci produk untuk dimasukkan.
Keluaran:
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.
Mulai Layanan MS SQL (Opsional).
### 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
Instal alat MS SQL Server di Linux
Konfigurasikan repositori alat server 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
Instal alat MS SQL (sqlcmd dan bcp), dan paket pengembang 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-devSaat menginstal alat server Microsoft SQL, Anda harus menerima persyaratan Lisensi.
Firewall
Konfigurasikan firewall untuk mengizinkan 1433 port sehingga kita dapat mengakses server SQL dari mesin eksternal.
FirewallD:
firewall-cmd --permanent --add-port=1433/tcp firewall-cmd --reload
UFW:
sudo ufw allow 8080/tcp sudo ufw reload
Hubungkan ke server MS SQL
sqlcmd perintah sekarang dapat ditemukan /opt/mssql-tools/bin direktori. Untuk membuat perintah alat tersedia untuk jalur shell, jalankan perintah berikut.
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile source ~/.bash_profile
Setelah instalasi selesai, sambungkan ke server MS SQL menggunakan perintah berikut.
sqlcmd -H 127.0.0.1 -U sa Password: 1>
Itu saja.