程序包管理器发生错误,因为无法启动SQL Server用户实例,原因是该用户实例的启动过程失败

时间:2019-06-30 01:27:22

标签: visual-studio-2017 nuget-package package-managers

虽然我在nuget软件包管理器中使用update-database命令。 得到 “由于无法为用户实例启动进程,因此无法生成SQL Server用户实例。连接将被关闭。”

我检查SQL Server配置 2检查SSMS登录 正常工作

有关更多详细信息,请检查完整日志。

PM> update -database

update:术语“更新”不被视为cmdlet,函数,脚本文件或可运行程序的名称。检查名称的拼写,或者是否包含路径,请验证路径是否正确,然后重试。 在第1行:char:1 +更新-数据库 + ~~~~~~     + CategoryInfo:ObjectNotFound :(更新:String)[],CommandNotFoundException     + FullyQualifiedErrorId:CommandNotFoundException

PM>更新数据库 指定“ -Verbose”标志以查看应用于目标数据库的SQL语句。 System.Data.SqlClient.SqlException(0x80131904):由于无法启动SQL Server的用户实例,导致启动该用户实例的过程失败。连接将关闭。    在System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject,UInt32 waitForMultipleObjectsTimeout,布尔值allowCreate,仅布尔值OneCheckConnection,DbConnectionOptions userOptions,DbConnectionInternal&连接)    在System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject,TaskCompletionSource 1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource 1重试,DbConnectionOptions userOptions,DbConnectionInternal oldConnection,DbConnectionInternal&连接)处    在System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal处(DbConnection externalConnection,DbConnectionFactory connectionFactory,TaskCompletionSource 1 retry, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource 1重试,DbConnectionOptions userOptions)    在System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource 1 retry) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource 1重试)    在System.Data.SqlClient.SqlConnection.Open()    在System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.b__36(DbConnection t,DbConnectionInterceptionContext c)    执行System.Data.Entity.Infrastructure.Interception.InternalDispatcher 1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action 2操作,执行TInterceptionContext拦截上下文,执行Action 3 executing, Action 3)    在System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(DbConnection连接,DbInterceptionContext拦截上下文)    在System.Data.Entity.SqlServer.SqlProviderServices。<> c__DisplayClass33.b__32()    在System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy。<> c__DisplayClass1.b__0()    在System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute [TResult](Func 1 operation) at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Action operation) at System.Data.Entity.SqlServer.SqlProviderServices.UsingConnection(DbConnection sqlConnection, Action 1动作)处    在System.Data.Entity.SqlServer.SqlProviderServices.UsingMasterConnection处(DbConnection sqlConnection,Action 1 act) at System.Data.Entity.SqlServer.SqlProviderServices.CreateDatabaseFromScript(Nullable 1 commandTimeout,DbConnection sqlConnection,字符串createDatabaseScript)    在System.Data.Entity.SqlServer.SqlProviderServices.DbCreateDatabase处(DbConnection连接,可空1 commandTimeout, StoreItemCollection storeItemCollection) at System.Data.Entity.Core.Common.DbProviderServices.CreateDatabase(DbConnection connection, Nullable 1 commandTimeout,StoreItemCollection storeItemCollection)    在System.Data.Entity.Core.Objects.ObjectContext.CreateDatabase()    在System.Data.Entity.Migrations.Utilities.DatabaseCreator.Create(DbConnection连接)    在System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(操作mustSucceedToKeepDatabase)    在System.Data.Entity.Migrations.Infrastructure.MigratorBase.EnsureDatabaseExists(操作mustSucceedToKeepDatabase)处    在System.Data.Entity.Migrations.DbMigrator.Update(String targetMigration)    在System.Data.Entity.Migrations.Infrastructure.MigratorBase.Update(String targetMigration)    在System.Data.Entity.Migrations.Design.ToolingFacade.UpdateRunner.RunCore()    在System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.Run() ClientConnectionId:1fc5ad95-2b73-4e43-bce3-ebee4805c3fe 错误号:15372,状态:1,类:14 由于启动用户实例的过程失败,因此无法生成SQL Server用户实例。连接将关闭。 PM>

1 个答案:

答案 0 :(得分:0)

对我有用

删除以下目录的内容:c:\ Users \\ AppData \ Local \ Microsoft \ Microsoft SQL Server Data \ SQLEXPRESS。

并运行命令

PM>更新数据库