我知道這個問題被問了很多次,但沒有任何主題爲我工作。 我已經發表了MVC網站到Plesk控制面板的網絡服務器,但我不斷收到此錯誤:CREATE DATABASE權限在數據庫'master'中被拒絕。當發佈到網絡服務器
CREATE DATABASE permission denied in database 'master'.
誰能告訴我這是怎麼回事?我花了三天,嘗試了一切。 這裏是我的連接字符串:
<connectionStrings>
<add name="application" connectionString="Data Source=.;Initial Catalog=bug.mdf;Integrated Security=false; User ID=admin;Password=###############" providerName="System.Data.SqlClient" />
</connectionStrings>
錯誤:
[SqlException (0x80131904): CREATE DATABASE permission denied in database 'master'.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +2434922
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +5736592
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +285
System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +3731
System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite) +940
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) +272
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +280
System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.<NonQuery>b__0(DbCommand t, DbCommandInterceptionContext`1 c) +10
System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch(TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed) +72
System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.NonQuery(DbCommand command, DbCommandInterceptionContext interceptionContext) +356
System.Data.Entity.SqlServer.<>c__DisplayClass1a.<CreateDatabaseFromScript>b__19(DbConnection conn) +119
System.Data.Entity.SqlServer.<>c__DisplayClass33.<UsingConnection>b__32() +443
System.Data.Entity.SqlServer.<>c__DisplayClass1.<Execute>b__0() +10
System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Func`1 operation) +189
System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Action operation) +78
System.Data.Entity.SqlServer.SqlProviderServices.UsingConnection(DbConnection sqlConnection, Action`1 act) +175
System.Data.Entity.SqlServer.SqlProviderServices.UsingMasterConnection(DbConnection sqlConnection, Action`1 act) +556
System.Data.Entity.SqlServer.SqlProviderServices.CreateDatabaseFromScript(Nullable`1 commandTimeout, DbConnection sqlConnection, String createDatabaseScript) +86
System.Data.Entity.SqlServer.SqlProviderServices.DbCreateDatabase(DbConnection connection, Nullable`1 commandTimeout, StoreItemCollection storeItemCollection) +164
System.Data.Entity.Core.Common.DbProviderServices.CreateDatabase(DbConnection connection, Nullable`1 commandTimeout, StoreItemCollection storeItemCollection) +76
System.Data.Entity.Core.Objects.ObjectContext.CreateDatabase() +134
System.Data.Entity.Migrations.Utilities.DatabaseCreator.Create(DbConnection connection) +119
System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(Action mustSucceedToKeepDatabase) +142
System.Data.Entity.Migrations.DbMigrator.Update(String targetMigration) +78
System.Data.Entity.Internal.DatabaseCreator.CreateDatabase(InternalContext internalContext, Func`3 createMigrator, ObjectContext objectContext) +89
System.Data.Entity.Internal.InternalContext.CreateDatabase(ObjectContext objectContext, DatabaseExistenceState existenceState) +116
System.Data.Entity.Database.Create(DatabaseExistenceState existenceState) +218
System.Data.Entity.CreateDatabaseIfNotExists`1.InitializeDatabase(TContext context) +151
System.Data.Entity.Internal.<>c__DisplayClassf`1.<CreateInitializationAction>b__e() +76
System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action) +60
System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization() +357
System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c) +7
System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input) +110
System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action) +198
System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase() +73
System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +28
System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +53
System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() +15
System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() +38
System.Linq.Queryable.OrderByDescending(IQueryable`1 source, Expression`1 keySelector) +83
連接字符串中的DB名稱Initial_CAtalog在哪裏? –
錯誤說它正在嘗試連接到主數據庫,它不應該被用於你的應用程序,它被sql server用於它的目的,所以你需要在連接字符串中添加你的數據庫名稱 –
我忘記寫數據庫有問題的名稱,但數據庫名稱不是問題。 – V47