SQL Server从文件创建证书失败

时间:2019-04-08 18:49:02

标签: sql sql-server

我正在尝试使用自签名证书且没有域环境但没有运气的SQL Server镜像方案。

首先,我做了这些命令,

CREATE master key Encryption by password = 'Aa123456';
Create certificate MirrorCert with subject = 'SQLMirror certificate'
Create endpoint endpoint_mirroring state = started as tcp(listener_port = 7024, listener_ip = all) for database_mirroring (authentication = certificate MirrorCert, encryption = disabled, role = all);
Backup certificate MirrorCert to file = 'c:\Backup\MirrorCert.cer';

但是在主服务器上,当使用以下命令将上述证书复制到该位置后尝试导入上述证书时:

CREATE CERTIFICATE SQL_Mirror_Cert AUTHORIZATION Mirror_user FROM FILE = '‪C:\Backup\MirrorCert.cer'

我收到此错误:

The certificate, asymmetric key, or private key file is not valid or does not exist; or you do not have permissions for it.

我不知道我犯了什么错误,我们将不胜感激。

更新: 除this link以外,我尝试了很多运气不好的事情,除了{{3}}谈到了从SQL Server生成的证书的NTFS权限,而且我不知道如何设置或重置证书权限(我尝试了证书文件传统的安全权限,但无效)。

0 个答案:

没有答案