[root@linuxidcbin]# pwd
/opt/mssql/bin
[root@linuxidcbin]# ./sqlservr-setup
Microsoft(R) SQL Server(R) Setup
You can abort setup at anytime by pressing Ctrl-C. Start this program
with the --help option for information about running it in unattended
mode.
The license terms for this product can be downloaded from
?LinkId=746388 and found
in /usr/share/doc/mssql-server/LICENSE.TXT.
Do you accept the license terms? If so, please type "YES": YES
Please enter a password for the system administrator (SA) account:
Please confirm the password for the system administrator (SA) account:
Setting system administrator (SA) account password...
sqlservr: This program requires a machine with at least 3250 megabytes of memory.
Microsoft(R) SQL Server(R) setup failed with error code 1.
Please check the setup log in /var/opt/mssql/log/setup-20161117-184346.log
for more information.
我采用的是A1的机器,配置过程提示,内存需要大于3G。把机器升级到A2:
[root@linuxidcserver bin]# ./sqlservr-setup
Microsoft(R) SQL Server(R) Setup
You can abort setup at anytime by pressing Ctrl-C. Start this program
with the --help option for information about running it in unattended
mode.
The license terms for this product can be downloaded from
?LinkId=746388 and found
in /usr/share/doc/mssql-server/LICENSE.TXT.
Do you accept the license terms? If so, please type "YES": YES
Please enter a password for the system administrator (SA) account:
Please confirm the password for the system administrator (SA) account:
Setting system administrator (SA) account password...
Do you wish to start the SQL Server service now? [y/n]: y
Do you wish to enable SQL Server to start on boot? [y/n]: y
Created symlink from /etc/systemd/system/multi-user.target.wants/mssql-server.service to /usr/lib/systemd/system/mssql-server.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/mssql-server-telemetry.service to /usr/lib/systemd/system/mssql-server-telemetry.service.
Setup completed successfully.
配置成功。检查状态:
[root@linuxidcserver bin]# systemctl status mssql
● mssql.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
[root@linuxidcserver bin]# systemctl status mssql-server
● mssql-server.service - Microsoft(R) SQL Server(R) Database Engine
Loaded: loaded (/usr/lib/systemd/system/mssql-server.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2016-11-17 19:52:06 UTC; 37s ago
Main PID: 1539 (sqlservr)
CGroup: /system.slice/mssql-server.service
├─1539 /opt/mssql/bin/sqlservr
└─1547 /opt/mssql/bin/sqlservr
Nov 17 19:52:14 linuxidcserver sqlservr[1539]: 2016-11-17 19:52:15.06 spid17s SQL Server is now ready for client connections. This is an infor...equired.
Nov 17 19:52:15 linuxidcserver sqlservr[1539]: 2016-11-17 19:52:15.13 spid6s Polybase feature disabled.
Nov 17 19:52:15 linuxidcserver sqlservr[1539]: 2016-11-17 19:52:15.13 spid6s Clearing tempdb database.
Nov 17 19:52:16 linuxidcserver sqlservr[1539]: 2016-11-17 19:52:16.91 spid6s Starting up database 'tempdb'.
Nov 17 19:52:17 linuxidcserver sqlservr[1539]: 2016-11-17 19:52:17.58 spid6s The tempdb database has 1 data file(s).
Nov 17 19:52:17 linuxidcserver sqlservr[1539]: 2016-11-17 19:52:17.58 spid20s The Service Broker endpoint is in disabled or stopped state.
Nov 17 19:52:17 linuxidcserver sqlservr[1539]: 2016-11-17 19:52:17.58 spid20s The Database Mirroring endpoint is in disabled or stopped state.
Nov 17 19:52:17 linuxidcserver sqlservr[1539]: 2016-11-17 19:52:17.67 spid20s Service Broker manager has started.
Nov 17 19:52:17 linuxidcserver sqlservr[1539]: 2016-11-17 19:52:17.71 spid5s Recovery is complete. This is an informational message only. No ...equired.
Nov 17 19:52:22 linuxidcserver sqlservr[1539]: 2016-11-17 19:52:22.59 spid35s The activated proc '[dbo].[sp_syspolicy_events_reader]' running on queue...
Hint: Some lines were ellipsized, use -l to show in full.
SQL Server已经在运行。
3. 检查
安装SQL Tools。SQL Tools:sqlcmd是mssql ODBC的一个工具,可以通过yum的repo直接yum安装。
首先下载yum的repo: