1、安装源
sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-preview.repo
[root@localhost etc]# cd /etc/yum.repos.d/ [root@localhost yum.repos.d]# ls CentOS-Base.repo CentOS-CR.repo CentOS-Debuginfo.repo CentOS-fasttrack.repo CentOS-Media.repo CentOS-Sources.repo CentOS-Vault.repo mssql-server.repo
2、安装MSSQL
yum install mssql-server
3、安装完成后,配置SETUP
[root@localhost /]# /opt/mssql/bin/mssql-conf setup
选择 SQL Server 的一个版本: 1) Evaluation (免费,无生产许可,180 天限制) 2) Developer (免费,无生产许可) 3) Express (免费) 4) Web (付费版) 5) Standard (付费版) 6) Enterprise (付费版) 7) Enterprise Core (付费版) 8) 我通过零售渠道购买了许可证并具有要输入的产品密钥。
可在以下位置找到有关版本的详细信息: https://go.microsoft.com/fwlink/?LinkId=852748&clcid=0x804
使用此软件的付费版本需要通过以下途径获取单独授权 Microsoft 批量许可计划。 选择付费版本即表示你具有适用的 要安装和运行此软件的就地许可证数量。
输入版本(1-8): 2 可以在以下位置找到此产品的许可条款: /usr/share/doc/mssql-server 或从以下位置下载: https://go.microsoft.com/fwlink/?LinkId=855862&clcid=0x804
可以从以下位置查看隐私声明: https://go.microsoft.com/fwlink/?LinkId=853010&clcid=0x804
接受此许可条款吗? [Yes/No]:yes
选择 SQL Server 的语言: (1) English (2) Deutsch (3) Español (4) Français (5) Italiano (6) 日本語 (7) 한국어 (8) Português (9) Русский (10) 中文 – 简体 (11) 中文 (繁体) 输入选项 1-11:1
输入 SQL Server 系统管理员密码: 确认 SQL Server 系统管理员密码: 正在配置 SQL Server…
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. 安装程序已成功完成。SQL Server 正在启动。
4、验证服务是否正常开启
[root@localhost /]# 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 一 2019-05-20 11:16:37 CST; 47s ago
Docs: https://docs.microsoft.com/en-us/sql/linux
Main PID: 26015 (sqlservr)
CGroup: /system.slice/mssql-server.service
├─26015 /opt/mssql/bin/sqlservr
└─26037 /opt/mssql/bin/sqlservr
5月 20 11:16:41 localhost.localdomain sqlservr[26015]: 2019-05-20 11:16:41.51 Server Server is listening on [ 127.0.0.1 <ipv4> 1434].
5月 20 11:16:41 localhost.localdomain sqlservr[26015]: 2019-05-20 11:16:41.51 Server Dedicated admin connection support was established for listening locally on port 1434.
5月 20 11:16:41 localhost.localdomain sqlservr[26015]: 2019-05-20 11:16:41.51 spid20s SQL Server is now ready for client connections. This is an informational message; no user action is required.
5月 20 11:16:42 localhost.localdomain sqlservr[26015]: 2019-05-20 11:16:41.99 spid9s Starting up database ‘tempdb’.
5月 20 11:16:42 localhost.localdomain sqlservr[26015]: 2019-05-20 11:16:42.24 spid9s The tempdb database has 1 data file(s).
5月 20 11:16:42 localhost.localdomain sqlservr[26015]: 2019-05-20 11:16:42.28 spid16s The Service Broker endpoint is in disabled or stopped state.
5月 20 11:16:42 localhost.localdomain sqlservr[26015]: 2019-05-20 11:16:42.28 spid16s The Database Mirroring endpoint is in disabled or stopped state.
5月 20 11:16:42 localhost.localdomain sqlservr[26015]: 2019-05-20 11:16:42.36 spid16s Service Broker manager has started.
5月 20 11:16:42 localhost.localdomain sqlservr[26015]: 2019-05-20 11:16:42.43 spid5s Recovery is complete. This is an informational message only. No user action is required.
5月 20 11:16:45 localhost.localdomain sqlservr[26015]: 2019-05-20 11:16:45.31 spid33s The activated proc ‘[dbo].[sp_syspolicy_events_reader]’ running on queue ‘msdb.dbo.syspolicy_event_queue’ output the following: ‘Transaction (Proc…
Hint: Some lines were ellipsized, use -l to show in full.
5、测试连接正常使用。