阿里云 Windows Server Version 数据中心版(不含UI) 安装MSSQL数据库

   由于本人安装的是SQL server-2017 Developer版,此文也仅以此版本的为例.首先需要下载SQL server安装包.下载之后会得到一个{SQLServer2017-SSEI-Dev.exe}Exe文件,双击该EXE程序,选择{下载介质}下载SQL server 完整安装包,为了方便建议选择{CAB}下载完成之后会得到两个同名的文件

将下载的两个文件通过FileZilla上传到服务器(在服务器安装FileZilla),在服务器上找到{SQLServer2017-DEV-x64-CHS.exe}右键运行,将BOX文件解压.解压完成之后我们需要准备安装时需要的配置文件:如下;可根据需要修改参数;

; SQL Server Configuration File  
[OPTIONS]  
; Specifies a Setup work flow, like INSTALL, UNINSTALL, or UPGRADE. This is a required parameter.   
ACTION="Install"  
; Specifies features to install, uninstall, or upgrade. The lists of features include SQLEngine, FullText, Replication, AS, IS, and Conn.   
FEATURES=SQLENGINE,FullText,Replication,AS,IS,Conn  
; Specify a default or named instance. MSSQLSERVER is the default instance for non-Express editions and SQLExpress for Express editions. This parameter is required when installing the ssNoVersion Database Engine (SQL), or Analysis Services (AS).  
INSTANCENAME="MSSQLSERVER"  
; Specify the Instance ID for the ssNoVersion features you have specified. ssNoVersion directory structure, registry structure, and service names will incorporate the instance ID of the ssNoVersion instance.   
INSTANCEID="MSSQLSERVER"  
; Account for ssNoVersion service: Domain\User or system account.   
SQLSVCACCOUNT="NT Service\MSSQLSERVER"  
; Windows account(s) to provision as ssNoVersion system administrators.   
SQLSYSADMINACCOUNTS="\<DomainName\UserName>";//这里需要根据各自的环境进行修改
; The name of the account that the Analysis Services service runs under.   
ASSVCACCOUNT= "NT Service\MSSQLServerOLAPService"  
; Specifies the list of administrator accounts that need to be provisioned.   
ASSYSADMINACCOUNTS="\<DomainName\UserName>";//这里需要根据各自的环境进行修改
; Specifies the server mode of the Analysis Services instance. Valid values are MULTIDIMENSIONAL, POWERPIVOT or TABULAR. ASSERVERMODE is case-sensitive. All values must be expressed in upper case.   
ASSERVERMODE="MULTIDIMENSIONAL"  
; Optional value, which specifies the state of the TCP protocol for the ssNoVersion service. Supported values are: 0 to disable the TCP protocol, and 1 to enable the TCP protocol.  
TCPENABLED=1  
;Specifies acceptance of License Terms  
IAcceptSQLServerLicenseTerms="True"

配置文件准备好之后保存为{.INI}格式;如{ConfigurationFile.INI},然后将文件上传到服务器,为了方便,我将文件上传到Sql Server安装目录

在任务管理器运行{Power shell} ,在power shell 中输入;目录根据各自情况进行修改,还需要做其他修改可参照{https://docs.microsoft.com/zh-cn/sql/database-engine/install-windows/install-sql-server-on-server-core?view=sql-server-2017}如果没有问题,就可以静等安装完成.

C:/Installapp/SQLServer2017-DEV-x64-CHS/setup.exe /qs /ConfigurationFile=C:/Installapp/SQLServer2017-DEV-x64-CHS/ConfigurationFile.INI

安装完成之后暂时是没办法在客户端通过SSMS工具连接到我们的数据库的,我们需要做以下配置;首先启用{SQL server和Windows身份验证模式}:在服务器的powershell中输入{regedit}打开注册表;依次找到{HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQLServer}将LoginMode值修改为{2},然后重启{SQLSERVER}服务.然后通过一下命令启用{sa}账户,并设置密码

sqlcmd
#查看sa 账户是否启用
SELECT name, type, is_disabled FROM sys.server_principals
go
#启用sa账户
ALTER LOGIN sa ENABLE
go
#设置sa账户密码
ALTER LOGIN sa WITH PASSWORD='xxxxxxxxxxxxxx'
go

处理完成之后,没有其问题,应该就可以通过SSMT工具在客户端上来连接数据库了.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值