然后导入公共库GPG密钥
root@match_test:~
% 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:~
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:~
% 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:~
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:~
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:~
-bash: /opt/mssql/bin/sqlservr-setup: No such file or directory
root@match_test:~
sudo: /opt/mssql/bin/sqlservr-setup: command not found
root@match_test:~
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:~
● 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]
|