IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 系统运维 -> sql-server安装部署ubuntu -> 正文阅读

[系统运维]sql-server安装部署ubuntu

然后导入公共库GPG密钥

root@match_test:~# curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   983  100   983    0     0   2934      0 --:--:-- --:--:-- --:--:--  2925
OK

注册Microsoft SQL Server Ubuntu存储库 命令如下:

root@match_test:~# apt install curl
Reading package lists... Done
Building dependency tree       
Reading state information... Done
curl is already the newest version (7.58.0-2ubuntu3.17).
curl set to manually installed.
The following packages were automatically installed and are no longer required:
  libcap2-bin libpam-cap
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
root@match_test:~# curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2019.list > /etc/apt/sources.list.d/mssql-server.list
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   103  100   103    0     0    851      0 --:--:-- --:--:-- --:--:--   851

下载并安装SQL Server,命令如下

root@match_test:~#  apt-get update
Get:1 https://packages.microsoft.com/ubuntu/16.04/mssql-server-2019 xenial InRelease [10.5 kB]
Get:2 https://packages.microsoft.com/ubuntu/16.04/mssql-server-2019 xenial/main armhf Packages [5,178 B]
Get:3 https://packages.microsoft.com/ubuntu/16.04/mssql-server-2019 xenial/main amd64 Packages [28.8 kB]
Get:4 https://packages.microsoft.com/ubuntu/16.04/mssql-server-2019 xenial/main arm64 Packages [5,178 B]
Hit:5 http://cn.archive.ubuntu.com/ubuntu bionic InRelease
Hit:6 http://cn.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:7 http://cn.archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:8 http://cn.archive.ubuntu.com/ubuntu bionic-security InRelease
Fetched 49.6 kB in 1s (36.6 kB/s)
Reading package lists... Done
root@match_test:~#  apt-get install -y mssql-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libcap2-bin libpam-cap
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  gdb gdbserver libbabeltrace1 libc++1 libc++abi1 libc6-dbg libdw1 libsasl2-modules-gssapi-mit libsss-nss-idmap0
Suggested packages:
  gdb-doc clang
The following NEW packages will be installed:
  gdb gdbserver libbabeltrace1 libc++1 libc++abi1 libc6-dbg libdw1 libsasl2-modules-gssapi-mit libsss-nss-idmap0 mssql-server
0 upgraded, 10 newly installed, 0 to remove and 5 not upgraded.
Need to get 261 MB of archives.
After this operation, 1,248 MB of additional disk space will be used.
Get:1 https://packages.microsoft.com/ubuntu/16.04/mssql-server-2019 xenial/main amd64 mssql-server amd64 15.0.4198.2-10 [252 MB]
Get:2 http://cn.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libdw1 amd64 0.170-0.4ubuntu0.1 [203 kB]
Get:3 http://cn.archive.ubuntu.com/ubuntu bionic/main amd64 libbabeltrace1 amd64 1.5.5-1 [154 kB]
Get:4 http://cn.archive.ubuntu.com/ubuntu bionic-updates/main amd64 gdb amd64 8.1.1-0ubuntu1 [2,937 kB]
Get:5 http://cn.archive.ubuntu.com/ubuntu bionic-updates/main amd64 gdbserver amd64 8.1.1-0ubuntu1 [282 kB]                                                                                                                                                                  
Get:6 http://cn.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libsasl2-modules-gssapi-mit amd64 2.1.27~101-g0780600+dfsg-3ubuntu2.4 [35.7 kB]                                                                                                                          
Get:7 http://cn.archive.ubuntu.com/ubuntu bionic/universe amd64 libc++abi1 amd64 6.0-2 [56.7 kB]                                                                                                                                                                             
Get:8 http://cn.archive.ubuntu.com/ubuntu bionic/universe amd64 libc++1 amd64 6.0-2 [183 kB]                                                                                                                                                                                 
Get:9 http://cn.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libc6-dbg amd64 2.27-3ubuntu1.5 [5,163 kB]                                                                                                                                                               
Get:10 http://cn.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libsss-nss-idmap0 amd64 1.16.1-1ubuntu1.8 [20.5 kB]                                                                                                                                                     
Fetched 261 MB in 12s (22.6 MB/s)                                                                                                                                                                                                                                            
Preconfiguring packages ...
Selecting previously unselected package libdw1:amd64.
(Reading database ... 77765 files and directories currently installed.)
Preparing to unpack .../0-libdw1_0.170-0.4ubuntu0.1_amd64.deb ...
Unpacking libdw1:amd64 (0.170-0.4ubuntu0.1) ...
Selecting previously unselected package libbabeltrace1:amd64.
Preparing to unpack .../1-libbabeltrace1_1.5.5-1_amd64.deb ...
Unpacking libbabeltrace1:amd64 (1.5.5-1) ...
Selecting previously unselected package gdb.
Preparing to unpack .../2-gdb_8.1.1-0ubuntu1_amd64.deb ...
Unpacking gdb (8.1.1-0ubuntu1) ...
Selecting previously unselected package gdbserver.
Preparing to unpack .../3-gdbserver_8.1.1-0ubuntu1_amd64.deb ...
Unpacking gdbserver (8.1.1-0ubuntu1) ...
Selecting previously unselected package libsasl2-modules-gssapi-mit:amd64.
Preparing to unpack .../4-libsasl2-modules-gssapi-mit_2.1.27~101-g0780600+dfsg-3ubuntu2.4_amd64.deb ...
Unpacking libsasl2-modules-gssapi-mit:amd64 (2.1.27~101-g0780600+dfsg-3ubuntu2.4) ...
Selecting previously unselected package libc++abi1:amd64.
Preparing to unpack .../5-libc++abi1_6.0-2_amd64.deb ...
Unpacking libc++abi1:amd64 (6.0-2) ...
Selecting previously unselected package libc++1:amd64.
Preparing to unpack .../6-libc++1_6.0-2_amd64.deb ...
Unpacking libc++1:amd64 (6.0-2) ...
Selecting previously unselected package libc6-dbg:amd64.
Preparing to unpack .../7-libc6-dbg_2.27-3ubuntu1.5_amd64.deb ...
Unpacking libc6-dbg:amd64 (2.27-3ubuntu1.5) ...
Selecting previously unselected package libsss-nss-idmap0.
Preparing to unpack .../8-libsss-nss-idmap0_1.16.1-1ubuntu1.8_amd64.deb ...
Unpacking libsss-nss-idmap0 (1.16.1-1ubuntu1.8) ...
Selecting previously unselected package mssql-server.
Preparing to unpack .../9-mssql-server_15.0.4198.2-10_amd64.deb ...
Unpacking mssql-server (15.0.4198.2-10) ...
Setting up libc++abi1:amd64 (6.0-2) ...
Setting up libc6-dbg:amd64 (2.27-3ubuntu1.5) ...
Setting up libsss-nss-idmap0 (1.16.1-1ubuntu1.8) ...
Setting up libdw1:amd64 (0.170-0.4ubuntu0.1) ...
Setting up gdbserver (8.1.1-0ubuntu1) ...
Setting up libsasl2-modules-gssapi-mit:amd64 (2.1.27~101-g0780600+dfsg-3ubuntu2.4) ...
Setting up libbabeltrace1:amd64 (1.5.5-1) ...
Setting up libc++1:amd64 (6.0-2) ...
Setting up gdb (8.1.1-0ubuntu1) ...
Setting up mssql-server (15.0.4198.2-10) ...

+--------------------------------------------------------------+
Please run 'sudo /opt/mssql/bin/mssql-conf setup'
to complete the setup of Microsoft SQL Server
+--------------------------------------------------------------+

Processing triggers for libc-bin (2.27-3ubuntu1.5) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...

当出现如下表示安装成功
在这里插入图片描述
安装完成后运行配置脚本并按照提示进行sa帐户的配置,命令如下: /opt/mssql/bin/sqlservr-setup

root@match_test:~# /opt/mssql/bin/sqlservr-setup
-bash: /opt/mssql/bin/sqlservr-setup: No such file or directory
root@match_test:~# sudo /opt/mssql/bin/sqlservr-setup
sudo: /opt/mssql/bin/sqlservr-setup: command not found
root@match_test:~# sudo /opt/mssql/bin/mssql-conf setup
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) - CPU Core utilization restricted to 20 physical/40 hyperthreaded
  7) Enterprise Core (PAID) - CPU Core utilization up to Operating System Maximum
  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=2109348&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): 5
The license terms for this product can be found in
/usr/share/doc/mssql-server or downloaded from:
https://go.microsoft.com/fwlink/?LinkId=2104294&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

Enter the SQL Server system administrator password: 
The specified password does not meet SQL Server password policy requirements because it is not complex enough. The password must be at least 8 characters long and contain characters from three of the following four sets: uppercase letters, lowercase letters, numbers, and symbols.
Enter the SQL Server system administrator password: 
Confirm the SQL Server system administrator password: 
Configuring SQL Server...

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

确认服务器是否开启并正常运行,命令如下:

systemctl status mssql-server

root@match_test:~# systemctl status mssql-server
● mssql-server.service - Microsoft SQL Server Database Engine
   Loaded: loaded (/lib/systemd/system/mssql-server.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2022-05-05 10:35:36 UTC; 12s ago
     Docs: https://docs.microsoft.com/en-us/sql/linux
 Main PID: 32584 (sqlservr)
    Tasks: 131
   CGroup: /system.slice/mssql-server.service
           ├─32584 /opt/mssql/bin/sqlservr
           └─32625 /opt/mssql/bin/sqlservr

May 05 10:35:43 match_test sqlservr[32584]: [78B blob data]
May 05 10:35:43 match_test sqlservr[32584]: [84B blob data]
May 05 10:35:43 match_test sqlservr[32584]: [145B blob data]
May 05 10:35:43 match_test sqlservr[32584]: [96B blob data]
May 05 10:35:44 match_test sqlservr[32584]: [66B blob data]
May 05 10:35:44 match_test sqlservr[32584]: [75B blob data]
May 05 10:35:44 match_test sqlservr[32584]: [96B blob data]
May 05 10:35:44 match_test sqlservr[32584]: [100B blob data]
May 05 10:35:44 match_test sqlservr[32584]: [124B blob data]
May 05 10:35:44 match_test sqlservr[32584]: [71B blob data]
  系统运维 最新文章
配置小型公司网络WLAN基本业务(AC通过三层
如何在交付运维过程中建立风险底线意识,提
快速传输大文件,怎么通过网络传大文件给对
从游戏服务端角度分析移动同步(状态同步)
MySQL使用MyCat实现分库分表
如何用DWDM射频光纤技术实现200公里外的站点
国内顺畅下载k8s.gcr.io的镜像
自动化测试appium
ctfshow ssrf
Linux操作系统学习之实用指令(Centos7/8均
上一篇文章      下一篇文章      查看所有文章
加:2022-05-07 11:29:31  更:2022-05-07 11:31:17 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/15 17:31:20-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码