在CentOS 7.3上安装SQL Server vNext CTP 1.2

此安装过程参考微软官方的安装文档:https://docs.microsoft.com/zh-tw/sql/linux/sql-server-linux-overview


支持的环境:


微软官方提示,在Linux上安装sql Server需要至少3.25GB的内存,否则会配置失败。

为了方便使用,这里采用的是CentOS Linux release 7.3.1611,配置了4GB的内存,也可以根据自己的实际情况进行选择合适的版本。

因为是联网下载安装,所以进行下列操作前,请确认网络是通的,否则会出现类似以下错误

获取 GPG 密钥失败:[Errno 14] curl#6 - "Could not resolve host:packages.microsoft.com;未知的名称或服务"

0curl: (6) Could notresolve host: packages.microsoft.com;未知的错误

下载微软sql Server红帽存储库配置文件:(配置yum源)

[root@localhost ~]# curl https://packages.microsoft.com/config/rhel/7/mssql-server.repo > /etc/yum.repos.d/mssql-server.repo

%Total % Received % Xferd Average Speed TimeTime Time Current

Dload UploadTotal Spent LeftSpeed

100220 100 2200 0 3410 --:--:-- --:--:-- --:--:-- 341

通过有root权限的用户进行安装:

[root@localhost ~]# yum install mssql-server

[root@localhost ~]# /opt/mssql/bin/sqlservr-setup


这里设置SA用户的密码、是否现在启动sql Server服务、是否设置sql Server开机自启

需要注意的是,如果配置的内存不符合要求,会配置失败:


添加内存后重新进行配置即可!如果是在虚拟机中安装的Linux,需要关机后才能添加大内存(3GB以上)。

至此,sql Server就已经安装好了!既然是安装在Linux系统上,那么肯定需要通过命令行的模式进行管理数据库,Oracle有sqlplus,sql Server有sqlcmd,但需要另外安装。


先配置yum源:

[root@localhost ~]# curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/msprod.repo

[root@localhost ~]# yum update

这个过程有点长……

[root@localhost ~]# yum update mssql-tools

[root@localhost bin]# sqlcmd -S localhost -U SA -P

好了,sql Server on Linux已经安装好了!

相关文章

Centos下搭建性能监控Spotlight
CentOS 6.3下Strongswan搭建IPSec VPN
在CentOS6.5上安装Skype与QQ
阿里云基于centos6.5主机VPN配置
CentOS 6.3下配置multipah
CentOS安装、配置APR和tomcat-native