无法在Azure SQL中为Master数据库创建主密钥 [英] Cannot create master key for master database in azure sql

查看:66
本文介绍了无法在Azure SQL中为Master数据库创建主密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Azure SQL.在Azure Portal中,我在其中创建了1个Azure SQL Server(用户名登录 user01 )和2个Azure SQL数据库( ExDatabase1 ExDatabase2 ).在 Microsoft SQL Server Management Studio 工具中,我使用用户 user01 登录成功.我正在使用透明数据加密(

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

但是,我收到了错误消息:
Msg 15247,第16级,状态1,第3行
用户无权执行此操作.那么,此当前用户(这是所有者数据库)的权限是什么?以及如何做到这一点?谢谢!

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!

推荐答案

不支持使用USE语句在数据库之间进行切换.使用新的连接来连接到Azure SQL数据库上的其他数据库.

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

要在Azure SQL中创建主键,只需在Azure SQL数据库上下文而非主数据库上运行以下语句.

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

这篇关于无法在Azure SQL中为Master数据库创建主密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆