Hi,
I tried to create Tenant with separate DB approach but I got errors and my tenant didn't create. Do I need to ask something to hosting provider? Below is log file errors
INFO 2017-07-26 00:02:38,065 [41 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method MyCompanyName.AbpZeroTemplate.MultiTenancy.TenantAppService.CreateTenant (MyCompanyName.AbpZeroTemplate.Application) with arguments (MyCompanyName.AbpZeroTemplate.MultiTenancy.Dto.CreateTenantInput) - ModelState is Valid
ERROR 2017-07-26 00:02:38,190 [12 ] Mvc.ExceptionHandling.AbpExceptionFilter - CREATE DATABASE permission denied in database 'master'.
System.Data.SqlClient.SqlException: CREATE DATABASE permission denied in database 'master'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource
1 completion, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite, String methodName)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, String executeMethod, IReadOnlyDictionary2 parameterValues, Boolean closeConnection) at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary
2 parameterValues)
at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IEnumerable1 migrationCommands, IRelationalConnection connection) at Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerDatabaseCreator.Create() at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration) at Abp.Zero.EntityFrameworkCore.AbpZeroDbMigrator
1.CreateOrMigrate(AbpTenantBase tenant, Action`1 seedAction)
at MyCompanyName.AbpZeroTemplate.MultiTenancy.TenantManager.
5 Answer(s)
-
0
Hi,
It seems like you don't have permisison to create a new database, you can ask it to your provider.
CREATE DATABASE permission denied in database 'master'.
Thanks.
-
0
Hi,
This is response from hosting provide " Sorry for the inconvenience. As security consideration, the only way to create database is from Control Panel ---> Databases. ". Is there any way around i can create tenant with this approach?
-
0
Yes, but you need to manually create the DB (empty) first and then you can use it's connection string for your new tenant.
Thanks.
-
0
Hi ismcagdas,
Yeah. that is the way I am thinking too. I need to store tenant connection in host table. right? Thanks
-
0
Hi,
Yes, it is stored in AbpTenants table in host database.