Cannot create master key for master database in azure sql

孤者浪人 提交于 2021-01-27 21:25:35

问题


i'm using Azure SQL. In Azure Portal, i was create 1 Azure SQL Server (with username login user01) and 2 Azure SQL Database (ExDatabase1 and ExDatabase2) inside it. In Microsoft SQL server management studio tool, i'm login success with user user01. i'm using transparent data encryption (TDE) and try create Database Master Key for master database with command bellow:

USE master;
Go
CREATE MASTER KEY ENCRYPTION by PASSWORD = 'Strongp@ssw0rd';
Go

But, i received error:
Msg 15247, Level 16, State 1, Line 3
User does not have permission to perform this action. So, what is permission for this current user (this is owner database)? and how to do that?. thanks!


回答1:


USE statement is not supported to switch between databases. Use a new connection to connect to a different database on Azure SQL Database.

To create a master key in Azure SQL just run the following statement on the Azure SQL Database context not on the master database.

 CREATE MASTER KEY 
 GO

For a full example please read this article.

Another example can be found here.

CREATE MASTER KEY ENCRYPTION BY PASSWORD='MyPassw0rdIsComplex.'
GO


来源:https://stackoverflow.com/questions/50459793/cannot-create-master-key-for-master-database-in-azure-sql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!