今天遇到一个案例,在使用命令修改一个测试服务器(SQL Server 2014标准版)的服务器排序规则时,遇到了下面错误信息

(具体账号信息脱敏处理,随机生成一个账号密码)

The Windows account sa does not exist and cannot be provisioned as a SQL Server system administrator

c:\SQLServer_12.0_Full>Setup /QUIET /ACTION=REBUILDDATABASE  /INSTANCENAME=MSSQL

SERVER /SQLSYSADMINACCOUNTS=sa   /SAPWD=Sa!y#456  /SQLCOLLATION=Chinese_PRC_CI_AS

Microsoft (R) SQL Server 2014 12.00.5000.00

Copyright (c) Microsoft Corporation.  All rights reserved.

The following error occurred:

The Windows account sa does not exist and cannot be provisioned as a SQL Server

system administrator.

Error result: -2061893626

Result facility code: 1306

Result error code: 6

Please review the summary.txt log for further details

后面折腾了很久后,发现这种写法居然是错误的,由于自己在动手之前参考了自己以前写的MS SQL 排序规则总结这篇博文,结果发现自己一些不严谨/错误的地方把自己也给坑了。希望不要把别人也坑了!!!时间太久远了,怎么也想不起当初怎么造就了这样一个错误, 总之,那篇博文里面确实有一个错误的地方。希望以后要引以为戒!

正确的写法为/SQLSYSADMINACCOUNTS参数后指定域账号或本机NT账号,这个可以通过查看帮助信息

c:\SQLServer_12.0_Full>Setup /QUIET /ACTION=REBUILDDATABASE  /INSTANCENAME=MSSQLSERVER

/SQLSYSADMINACCOUNTS=azrnt18\azrnt18    /SAPWD="Sa!y#456" /SQLCOLLATION=Chinese_PRC_CI_AS

Microsoft (R) SQL Server 2014 12.00.5000.00

Copyright (c) Microsoft Corporation.  All rights reserved.

setup /? 或setup  /help查看参数信息,SQLSYSADMINACCOUNTS的介绍、解释如下所示:

SQLSYSADMINACCOUNTS    Windows account(s) to provision as SQL Server system administrators.

也就是说SQLSYSADMINACCOUNTS参数后指定的是有SQL Server管理员权限的Windows账号,由于最上面最上面指定参数的值为sa,所以才会一直报这个错误。

c:\SQLServer_12.0_Full>setup /help

Microsoft (R) SQL Server 2014 12.00.5000.00

Copyright (c) Microsoft Corporation.  All rights reserved.

 

Usage:

 setup.exe /[option]={value} /[option]={value} ...

 

 Options:

 ACTION                       Specifies a Setup work flow, like INSTALL,

                              UNINSTALL, or UPGRADE. This is a required

                              parameter.

 ADDCURRENTUSERASSQLADMIN     Provision current user as a Database Engine

                              system administrator for %SQL_PRODUCT_SHORT_NAME%

                              Express.

 AGTDOMAINGROUP               Either domain user name or system account

 AGTSVCACCOUNT                Either domain user name or system account

 AGTSVCPASSWORD               Password for domain user name. Not required for

                              system account

 AGTSVCSTARTUPTYPE            Startup type for the SQL Server Agent service.

                              Supported values are Manual, Automatic or

                              Disabled.

 ALLINSTANCES                 Specifies that all instances are to be included

                              in the Setup operation. This parameter is

                              supported only when applying a patch.

 ALLOWUPGRADEFORSSRSSHAREPOIN

                              RSInputSettings_AllowUpgradeForSSRSSharePointMode_

Description

 ASBACKUPDIR                  The location for the Analysis Services backup

                              files.

 ASCOLLATION                  The collation used by Analysis Services.

 ASCONFIGDIR                  The location for the Analysis Services

                              configuration files.

 ASDATADIR                    The location for the Analysis Services data

                              files.

 ASLOGDIR                     The location for the Analysis Services log files.

 ASPROVIDERMSOLAP             Specifies if the MSOLAP provider can run in

                              process.

 ASSERVERMODE                 Specifies the server mode of the Analysis

                              Services instance. Valid values are

                              MULTIDIMENSIONAL and TABULAR. The default value

                              is MULTIDIMENSIONAL.

 ASSVCACCOUNT                 The account used by the Analysis Services

                              service.

 ASSVCPASSWORD                The password for the Analysis Services service

                              account.

 ASSVCSTARTUPTYPE             Controls the service startup type setting for the

                              service.

 ASSYSADMINACCOUNTS           Specifies the list of administrator accounts to

                              provision.

 ASTEMPDIR                    The location for the Analysis Services temporary

                              files.

 BROWSERSVCSTARTUPTYPE        Startup type for Browser Service.

 CLTCTLRNAME                  The computer name that the client communicates

                              with for the Distributed Replay Controller

                              service.

 CLTRESULTDIR                 The result directory for the Distributed Replay

                              Client service.

 CLTSTARTUPTYPE               The startup type for the Distributed Replay

                              Client service.

 CLTSVCACCOUNT                The account used by the Distributed Replay Client

                              service.

 CLTSVCPASSWORD               The password for the Distributed Replay Client

                              service account.

 CLTWORKINGDIR                The working directory for the Distributed Replay

                              Client service.

 CLUSTERPASSIVE               Specifies that SQL Server Setup should not manage

                              the SQL Server services. This option should be

                              used only in a non-Microsoft cluster environment.

 COMMFABRICENCRYPTION         MATRIXCOMMMESSAGEPROTECTION {0,1}

 COMMFABRICNETWORKLEVEL       MATRIXCOMMNETWORKISOLATION {0,1}

 COMMFABRICPORT               MATRIXCOMMPORT <port>

 CONFIGURATIONFILE            Specifies the configuration file to be used for

                              Setup.

 CONFIRMIPDEPENDENCYCHANGE    Indicates that the change in IP address resource

                              dependency type for the SQL Server multi-subnet

                              failover cluster is accepted.

 CTLRSTARTUPTYPE              The startup type for the Distributed Replay

                              Controller service.

 CTLRSVCACCOUNT               The account used by the Distributed Replay

                              Controller service.

 CTLRSVCPASSWORD              The password for the Distributed Replay

                              Controller service account.

 CTLRUSERS                    The Windows account(s) used to grant permission

                              to the Distributed Replay Controller service.

 ENABLERANU                   Set to "1" to enable RANU for SQL Server Express.

 ENU                          Use the /ENU parameter to install the English

                              version of SQL Server on your localized Windows

                              operating system.

 ERRORREPORTING               Specify if errors can be reported to Microsoft to

                              improve future SQL Server releases. Specify 1 or

                              True to enable and 0 or False to disable this

                              feature.

 FAILOVERCLUSTERDISKS         Specifies a cluster shared disk to associate with

                              the SQL Server failover cluster instance.

 FAILOVERCLUSTERGROUP         Specifies the name of the cluster group for the

                              SQL Server failover cluster instance.

 FAILOVERCLUSTERIPADDRESSES   Specifies an encoded IP address. The encodings

                              are semicolon-delimited (;), and follow the

                              format <IP Type>;<address>;<network name>;<subnet

                              mask>. Supported IP types include DHCP, IPV4, and

                              IPV6.

 FAILOVERCLUSTERNETWORKNAME   Specifies the name of the SQ LServer failover

                              cluster instance.  This name is the network name

                              that is used to connect to SQL Server services.

 FAILOVERCLUSTERROLLOWNERSHIP Specifies whether the upgraded nodes should take

                              ownership of the failover instance group or not.

                              Use 0 to retain ownership in the legacy nodes, 1

                              to make the upgraded nodes take ownership, or 2

                              to let SQL Server Setup decide when to move

                              ownership.

 FEATURES                     Specifies features to install, uninstall, or

                              upgrade. The list of top-level features include

                              SQL, AS, RS, IS, MDS, and Tools. The SQL feature

                              will install the Database Engine, Replication,

                              Full-Text, and Data Quality Services (DQS)

                              server. The Tools feature will install Management

                              Tools, Books online components, SQL Server Data

                              Tools, and other shared components.

 FILESTREAMLEVEL              Level to enable FILESTREAM feature at (0, 1, 2 or

                              3).

 FILESTREAMSHARENAME          Name of Windows share to be created for

                              FILESTREAM File I/O.

 FTSVCACCOUNT                 User account for Full-text Filter Daemon Host.

 FTSVCPASSWORD                User password for Full-text Filter Daemon Host

                              account.

 FTUPGRADEOPTION              Full-text catalog upgrade option.

 HELP                         Displays the command line parameters usage

 IACCEPTSQLSERVERLICENSETERMS By specifying this parameter and accepting the

                              SQL Server license terms, you acknowledge that

                              you have read and understood the terms of use.

 INDICATEPROGRESS             Specifies that the detailed Setup log should be

                              piped to the console.

 INSTALLSHAREDDIR             Specify the root installation directory for

                              shared components.  This directory remains

                              unchanged after shared components are already

                              installed.

 INSTALLSHAREDWOWDIR          Specify the root installation directory for the

                              WOW64 shared components.  This directory remains

                              unchanged after WOW64 shared components are

                              already installed.

 INSTALLSQLDATADIR            The Database Engine root data directory.

 INSTANCEDIR                  Specify the instance root directory.

 INSTANCEID                   Specify the Instance ID for the SQL Server

                              features you have specified. SQL Server directory

                              structure, registry structure, and service names

                              will incorporate the instance ID of the SQL

                              Server instance.

 INSTANCENAME                 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 SQL

                              Server Database Engine (SQL), Analysis Services

                              (AS), or Reporting Services (RS).

 ISSVCACCOUNT                 Either domain user name or system account.

 ISSVCPASSWORD                Password for domain user.

 ISSVCSTARTUPTYPE             Automatic, Manual or Disabled.

 MATRIXCMBRICKCOMMPORT        MATRIXCMBRICKCOMMPORT portNumber

 MATRIXCMSERVERNAME           MATRIXCMSERVERNAME hostName\instanceName

 MATRIXNAME                   MATRIXNAME=<name>

 NPENABLED                    Specify 0 to disable or 1 to enable the Named

                              Pipes protocol.

 PID                          Specify the SQL Server product key to configure

                              which edition you would like to use.

 QUIET                        Setup will not display any user interface.

 QUIETSIMPLE                  Setup will display progress only, without any

                              user interaction.

 ROLE                         Detailed help for command line argument ROLE has

                              not been defined yet.

 RSCATALOGSERVERINSTANCENAME  The SQL Server server for the report server

                              catalog database.

 RSINSTALLMODE                RSInputSettings_RSInstallMode_Description

 RSSHPINSTALLMODE             RSInputSettings_RSInstallMode_Description

 RSSVCACCOUNT                 Specify the service account of the report server.

                              This value is required. If you omit this value,

                              Setup will use the default built-in account for

                              the current operating system (either

                              NetworkService or LocalSystem). If you specify a

                              domain user account, the domain must be under 254

                              characters and the user name must be under 20

                              characters. The account name cannot contain the

                              following characters:

                              " / \ [ ] : ; | = , + * ? < >

 RSSVCPASSWORD                Specify a strong password for the account. A

                              strong password is at least 8 characters and

                              includes a combination of upper and lower case

                              alphanumeric characters and at least one symbol

                              character. Avoid spelling an actual word or name

                              that might be listed in a dictionary.

 RSSVCSTARTUPTYPE             Specifies the startup mode for the Report Server

                              service. Valid values include Manual, Automatic,

                              and Disabled. The default value for StartupType

                              is Manual, where the server is started when a

                              request is received.

 RSUPGRADEDATABASEACCOUNT     RSInputSettings_RSInstallMode_Description

 RSUPGRADEPASSWORD            RSInputSettings_RSInstallMode_Description

 RULES                        Specifies the list of rule IDs or rule group IDs

                              to run.

 SAPWD                        Password for SQL Server sa account.

 SECURITYMODE                 The default is Windows Authentication. Use "SQL"

                              for Mixed Mode Authentication.

 SQLBACKUPDIR                 Default directory for the Database Engine backup

                              files.

 SQLCOLLATION                 Specifies a Windows collation or an SQL collation

                              to use for the Database Engine.

 SQLSVCACCOUNT                Account for SQL Server service: Domain\User or

                              system account.

 SQLSVCPASSWORD               A SQL Server service password is required only

                              for a domain account.

 SQLSVCSTARTUPTYPE            Startup type for the SQL Server service.

 SQLSYSADMINACCOUNTS          Windows account(s) to provision as SQL Server

                              system administrators.

 SQLTEMPDBDIR                 Directory for Database Engine TempDB files.

 SQLTEMPDBLOGDIR              Directory for the Database Engine TempDB log

                              files.

 SQLUSERDBDIR                 Default directory for the Database Engine user

                              databases.

 SQLUSERDBLOGDIR              Default directory for the Database Engine user

                              database logs.

 SQMREPORTING                 Specify that SQL Server feature usage data can be

                              collected and sent to Microsoft. Specify 1 or

                              True to enable and 0 or False to disable this

                              feature.

 TCPENABLED                   Specify 0 to disable or 1 to enable the TCP/IP

                              protocol.

 UIMODE                       Parameter that controls the user interface

                              behavior. Valid values are Normal for the full

                              UI,AutoAdvance for a simplied UI, and

                              EnableUIOnServerCore for bypassing Server Core

                              setup GUI block.

 UpdateEnabled                Specify whether SQL Server Setup should discover

                              and include product updates. The valid values are

                              True and False or 1 and 0. By default SQL Server

                              Setup will include updates that are found.

 UpdateSource                 Specify the location where SQL Server Setup will

                              obtain product updates. The valid values are "MU"

                              to search Microsoft Update, a valid folder path,

                              a relative path such as .\MyUpdates or a UNC

                              share. By default SQL Server Setup will search

                              Microsoft Update or a Windows Update service

                              through the Window Server Update Services.

 USEMICROSOFTUPDATE           If this parameter is provided, then this computer

                              will use Microsoft Update to check for updates.

 X86                          Specifies that Setup should install into WOW64.

                              This command line argument is not supported on an

                              IA64 or a 32-bit system.

 

Full unattended installation example, showing all required parameters:

 

 

setup.exe /Q /IACCEPTSQLSERVERLICENSETERMS /ACTION=install /PID=<validpid> /FEAT

URES=SQL,AS,RS,IS,Tools

/INSTANCENAME=MSSQLSERVER /SQLSVCACCOUNT="MyDomain\MyAccount"

/SQLSVCPASSWORD="************" /SQLSYSADMINACCOUNTS="MyDomain\MyAccount "

/AGTSVCACCOUNT="MyDomain\MyAccount" /AGTSVCPASSWORD="************"

/ASSVCACCOUNT="MyDomain\MyAccount" /ASSVCPASSWORD="************"

/RSSVCACCOUNT="MyDomain\MyAccount" /RSSVCPASSWORD="************"

/ISSVCAccount="MyDomain\MyAccount" /ISSVCPASSWORD="************"

/ASSYSADMINACCOUNTS="MyDomain\MyAccount"

 

Press any key to exit...

The Windows account sa does not exist and cannot be provisioned as a SQL Server system administrator的更多相关文章

  1. Migrating Oracle on UNIX to SQL Server on Windows

    Appendices Published: April 27, 2005 On This Page Appendix A: SQL Server for Oracle Professionals Ap ...

  2. SQL Server 2005中更改sa的用户名和密码

    修改数据库SA账号名称的代码如下:  代码如下: Alter LOGIN sa DISABLE Alter LOGIN sa WITH NAME = [systemAccount] "sys ...

  3. SQL Server SA 最佳实践(也许不仅仅是翻译)

    老实说,本文主要部分是翻译的,并且由于英语水平的问题,我没有完全翻译,有些我觉得不重要的就跳过了,目前看来应该八九不离十,或者说不会影响最终效果,对于英语水平好的读者,可以自行查看原文.但这一年里面我 ...

  4. 解决 SQL Server 所有帐号无 sysadmin 权限,且未启用 SQL Server 身份验证,sa 帐号也未启用的问题

    解决 未启用 SQL Server 身份验证 的问题: 1. 运行 regedit,进入注册表编辑器 2. 打开:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Micro ...

  5. SQL Server 2008开启sa账户以及如何用JDBC进行连接

    做实验需要用Java与SQL Server连接,因为使用的 SQL 2008 Express Edition 是基于 Visual Studio2010 安装包安装时一起安装的,所以为了方便数据库的操 ...

  6. 将SQL Server账户对应到Windows系统账户

    应用场景举例: SQL Server账户要访问外部资源,例如所拥有的Job要访问文件系统,而此文件系统需要Windows账户才有权限. 步骤: 1.       服务器新建凭据(Credentials ...

  7. 如何将SQL Server运行到Windows Azure上

    从2012年6月6日开始,Windows Azure上一些强大的新功能现在可用于预览,包括新的Windows Azure虚拟机(VM).其中有关Windows Azure虚拟机最强大的一件事是他们利用 ...

  8. Windows XP系统安装SQL Server 2005(开发版)图解

    转自Windows XP系统安装SQL Server 2005(开发版)图解 安装前提:由于有些从网上的下载的项目需要导入SQL Server 2005的数据文件,因此,今天便安装了这个数据库,我的系 ...

  9. 配置Windows 防火墙,允许SQL Server的远程连接

    在运行SQL Server的服务器上,我们要找到哪些是SQL Server正在侦听的端口,并将其添加到Windows防火墙的入站例外. 首先,我们需要添加 SQL Server 服务侦听 Window ...

随机推荐

  1. 【视频编解码·学习笔记】4. H.264的码流封装格式

    一.码流封装格式简单介绍: H.264的语法元素进行编码后,生成的输出数据都封装为NAL Unit进行传递,多个NAL Unit的数据组合在一起形成总的输出码流.对于不同的应用场景,NAL规定了一种通 ...

  2. bzoj4326 运输计划

    4326: NOIP2015 运输计划 Time Limit: 30 Sec  Memory Limit: 128 MB Description 公元 2044 年,人类进入了宇宙纪元.L 国有 n ...

  3. redis通过pipeline提升吞吐量

    案例目标 简单介绍 redis pipeline 的机制,结合一段实例说明pipeline 在提升吞吐量方面发生的效用. 案例背景 应用系统在数据推送或事件处理过程中,往往出现数据流经过多个网元: 然 ...

  4. Linux 下定时备份数据库以及删除缓存

    一.定时备份数据库 1.在根目录下创建备份文件夹 #mkdir backup 2.进入到该目录下,创建backup.sh文件 3.赋予文件权限让其变成可执行文件 4.在backup.sh中写备份的脚本 ...

  5. Docker+Jenkins持续集成环境(5): android构建与apk发布

    项目组除了常规的java项目,还有不少android项目,如何使用jenkins来实现自动构建呢?本文会介绍安卓项目通过jenkins构建的方法,并设计开发一个类似蒲公英的app托管平台. andro ...

  6. Effective Java 之-----返回零长度的数组或集合而不是null

    如下代码,通常用户列表为空时,会习惯性返回null,因为这时会认为:null返回值比零长度数组更好,因为它避免了分配数组所需要的开销. private final List<UserBean&g ...

  7. IOLI-crackme0x01-0x05 writeup

    上一篇开了个头, 使用Radare2并用3中方法来解决crackme0x00, 由于是第一篇, 所以解释得事无巨细, 今天就稍微加快点步伐, 分析一下另外几个crackme. 如果你忘记了crackm ...

  8. bzoj 1975: [Sdoi2010]魔法猪学院 [k短路]

    1975: [Sdoi2010]魔法猪学院 裸题... 被double坑死了 #include <iostream> #include <cstdio> #include &l ...

  9. BZOJ 2287. [HZOI 2015]疯狂的机器人 [FFT 组合计数]

    2287. [HZOI 2015]疯狂的机器人 题意:从原点出发,走n次,每次上下左右不动,只能在第一象限,最后回到原点方案数 这不煞笔提,组合数写出来发现卷积NTT,然后没考虑第一象限gg 其实就是 ...

  10. EFCore数据库迁移命令整理

    前言  因为现在用.net core 开发新项目,过程中需要经常涉及到数据命令的迁移,今天分别整EFCore 的两种迁移数据库的方式 1 程序包管理器控制台 , Package Manager Con ...