Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Horizon view7.7 (1) installation of basic environment configuration database

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This lab environment uses the database of MSSQL 2017 for linux. According to the official compatibility list of VMware, the database supports MSSQL 2017 Standard Edition and Enterprise Edition.

OS: Ubuntu server 16.0.4.5 LTS

Hardware configuration

Cpu:2 core

Memory: 16 GB

Harddisk: sda 16GB for OS;sdb 100 GB for data

Create a data volume

1) create data partitions that can be used for volumes

Fdisk / dev/sdb

Enter n, p, t, 8e, w

2) create volume information

Generate physical volumes

Pvcreate / dev/sdb1

Create a volume group datapool

Vgcreate datapool / dev/sdb1

Create a logical volume mssql in the volume group datapool

Lvcreate-l 100%FREE-n mssql datapool

Format the volume group as ext4

Mkfs.ext4 / dev/datapool/mssql

Load volume group

Mount-t ext4 / dev/datapool/mssql / data/

Power on and load automatically

Vim / etc/fstab

/ dev/datapool/mssql / data/ ext4 default 0 0

Parameter meaning

Options parameter

Auto: the system mounts automatically. This is the default option for fstab.

Defaults: rw, suid, dev, exec, auto, nouser, and async.

Noauto does not mount automatically when it starts.

Nouser can only be mounted by super users

Ro is mounted with read-only permission

Rw is mounted with readable and writable permissions

User can be mounted by any user

Please note that optical and floppy drives can be mounted only when the media is installed, so it is noauto

The fifth column is the dump backup settings.

When its value is set to 1, dump backup program backup is allowed; when set to 0, backup operation is ignored.

The sixth column is the fsck disk check settings.

The value is in an order. When the value is 0, it is never checked; the / root partition is always 1. Other partitions start at 2, and the smaller the number, the first to check. If the numbers of the two partitions are the same, check at the same time.

When the file is modified and saved, the restart of the server takes effect.

3) install MSSQL 2017 for Linux

Add a source for installation

Sudo curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add-

Preview (2019) 2019

Sudo add-apt-repository "$(curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-preview.list)"

CU 2017 (regular cumulative updates, normal system updates)

Sudo add-apt-repository "$(curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list)"

{The Cumulative Update (CU) repository contains packages for the base SQL Server release and any bug fixes or improvements since that release. Cumulative updates are specific to a release version, such as SQL Server 2017. They are released on a regular cadence.}

GDR 2017 (patches that update only ctrical are similar to LTSC)

Sudo add-apt-repository "$(curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017-gdr.list)"

{The GDR repository contains packages for the base SQL Server release and only critical fixes and security updates since that release. These updates are also added to the next CU release.}

Sudo apt-get update

Sudo apt-get install mssql-server

Install mssql command line management tools

Curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add-

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

Sudo apt-get update

Sudo apt-get install mssql-tools unixodbc-dev

Add SQL tools to bash

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

Echo 'export PATH= "$PATH:/opt/mssql-tools/bin" > > ~ / .bashrc

Source / .bashrc

Configure (initialize) the MSSQL database

Sudo / opt/mssql/bin/mssql-conf setup

Check whether MSSQL is installed successfully

Sqlcmd-S localhost-U SA-Q 'select @ @ VERSION'

Log in to MSSQL

Sqlcmd-S localhost-U SA-P''

Note that if you need to put mssql data in a new location directory, you need the following permissions

Drwxrwx--- 3 mssql mssql 4.0K Feb 22 15:44 mssql

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report