Linux系统中安装SQLServer

282 阅读1分钟

本文已参与“新人创作礼”活动,一起开启掘金创作之路。​​ ​

 一、设置镜像

curl https://packages.microsoft.com/config/rhel/7/mssql-server-2017.repo > /etc/yum.repos.d/mssql-server.repo

二、通过yum安装SQLServer

yum install -y mssql-server

三、运行安装程序

A.安装以后我们可以在opt下面看到mssql这个路径,具体的执行文件在这里面:

​​

 B.运行/mssql/bin/mssql-conf的文件:

sudo /opt/mssql/bin/mssql-conf setup

会让我们选择安装的SQLServer版本:
1)评估(免费,无生产使用权,期限为180天)
2)开发人员(免费,没有生产使用权)
3)快递(免费)
4)网页(PAID)
5)标准(PAID)
6)企业(PAID)
7)企业核心(PAID)
8)我通过零售渠道购买了许可证,并且需要输入产品密钥。

这里我选择2号版本。

​​

 四、设置启动密码

但是密码一定要注意,简单的密码不能通过:

报错:
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.

指定的密码不够复杂,因此不符合SQL Server密码策略要求。 密码长度必须至少为8个字符,并且必须包含以下四组中的三组字符:大写字母,小写字母,数字和符号。

最后安装成功:

五、将SQLServer设为开启启动项

systemctl enable mssql-server

​​

 六、查看SQLServer

七、Navicat中测试连接SQLServer

SQL Server默认用户名是sa,密码是安装的时候设置的密码,连接服务器的时候选择SQL Server身份验证,输入用户名和密码就完成了:

以上在Linux中安装SQLServer成功。