1.安装 Microsoft SQL Server 2019
# 下载 Microsoft SQL Server Red Hat 存储库配置文件
[root@192 ~]# sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2019.repo
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 231 100 231 0 0 662 0 --:--:-- --:--:-- --:--:-- 663
# 通过yum 安装 SQL Server
[root@192 lnmp1.6]# yum install -y mssql-server
# 配置 Microsoft SQL Server
[root@192 ~]# sudo /opt/mssql/bin/mssql-conf setup
usermod: no changes
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=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):2
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): 2
The license terms for this product can be found in
/usr/share/doc/mssql-server or downloaded from:
https://go.microsoft.com/fwlink/?LinkId=855862&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:
Confirm the SQL Server system administrator password:
Configuring SQL Server...
# 查看是否安装成功
[root@192 ~]# systemctl status mssql-server
● mssql-server.service - Microsoft SQL Server Database Engine
Loaded: loaded (/usr/lib/systemd/system/mssql-server.service; enabled; vendor preset: disabled)
Active: active (running) since Sun 2019-11-10 17:22:34 CST; 27s ago
Docs: https://docs.microsoft.com/en-us/sql/linux
Main PID: 3476 (sqlservr)
CGroup: /system.slice/mssql-server.service
├─3476 /opt/mssql/bin/sqlservr
└─3508 /opt/mssql/bin/sqlservr
Nov 10 17:22:39 192.168.0.105 sqlservr[3476]: 2019-11-10 17:22:39.49 spid23s SQL Server is now ready for client connections. This is an informational message; no user a...is required.
Nov 10 17:22:39 192.168.0.105 sqlservr[3476]: 2019-11-10 17:22:39.57 spid12s Clearing tempdb database.
Nov 10 17:22:39 192.168.0.105 sqlservr[3476]: 2019-11-10 17:22:39.58 spid10s 0 transactions rolled back in database 'msdb' (4:0). This is an informational message only....is required.
Nov 10 17:22:40 192.168.0.105 sqlservr[3476]: 2019-11-10 17:22:40.29 spid12s [2]. Feature Status: PVS: 0. CTR: 0. ConcurrentPFSUpdate: 1.
Nov 10 17:22:40 192.168.0.105 sqlservr[3476]: 2019-11-10 17:22:40.29 spid12s Starting up database 'tempdb'.
Nov 10 17:22:41 192.168.0.105 sqlservr[3476]: 2019-11-10 17:22:41.19 spid12s The tempdb database has 4 data file(s).
Nov 10 17:22:41 192.168.0.105 sqlservr[3476]: 2019-11-10 17:22:41.23 spid25s The Service Broker endpoint is in disabled or stopped state.
Nov 10 17:22:41 192.168.0.105 sqlservr[3476]: 2019-11-10 17:22:41.24 spid25s The Database Mirroring endpoint is in disabled or stopped state.
Nov 10 17:22:41 192.168.0.105 sqlservr[3476]: 2019-11-10 17:22:41.28 spid25s Service Broker manager has started.
Nov 10 17:22:41 192.168.0.105 sqlservr[3476]: 2019-11-10 17:22:41.29 spid10s Recovery is complete. This is an informational message only. No user action is required.
Hint: Some lines were ellipsized, use -l to show in full.
2. 安装图形化数据库操作软件 Azure Data Studio
[root@192 ~]# cd /usr/local/src
[root@192 src]# wget https://azuredatastudiobuilds.blob.core.windows.net/releases/1.13.0/azuredatastudio-linux-1.13.0.tar.gz
[root@192 src]# tar -xvf ./azuredatastudio-linux-1.13.0.tar.gz -C /usr/local
[root@192 src]# cd ../
[root@192 local]# echo 'export PATH="$PATH:/usr/local/azuredatastudio-linux-x64"' >> ~/.bashrc
[root@192 local]# source ~/.bashrc
# 启动图形化数据库操作界面
[root@192 local]# azuredatastudio
# 配置非root用户使用
[root@192 local]# exit
[gjp@192 local]# echo 'export PATH="$PATH:/usr/local/azuredatastudio-linux-x64"' >> ~/.bashrc
[gjp@192 local]# source ~/.bashrc
# 此处需要安装 libXScrnSaver 依赖 否则会报找不到 libgtk-3.so.0
[root@192 local]# yum install libXScrnSaver
# 注意 此处使用的是图形化安装的CentOS7
[gjp@192 local]# azuredatastudio
# windows访问时记得关闭防火墙
[root@192 ~]# systemctl stop firewalld
[root@192 ~]# systemctl disable firewalld
3. CentOS7 使用Azure Data Studio连接 Microsoft SQL Server 2019
4.2 Windows连接MSSQL 之 使用 原生 SSMS 连接(推荐使用)
因为之前有用Navicat进行过一次数据库远程备份,然后导致生产环境存储过程出现异常,然后后期果断换了官方的SSMS操作[捂脸笑][捂脸笑][捂脸笑]
4.2 Windows连接MSSQL 之 使用 Navicat连接