I have a site hosted on shared hosting, and when trying to run 'update-database' I get this error:
This operation requires a connection to the 'master' database. Unable to create a connection to the 'master' database because the original database connection has been opened and credentials have been removed from the connection string. Supply an unopened connection.
Obviously provider won't give me an access to master. Am I out of luck?
Best How To :
update-database does indeed need access to the 'master' database in order to add new databases. Entity Framework assumes the database to not exist by default, and will run
Create Database. If your host provider is only giving you access to a shared instance instead of your own instance on a shared server, then you probably can't create new Databases without their help.
If you use the command
Update-Database -Script -SourceMigration: $InitialDatabase, it will generate a
.sql script which can be run against the database, either by your hosting provider or through whatever portal they provide you.