I am new in SQL Server.
I am trying to setup mirroring and my both SQL Server instances are on same physical machine and this machine is not in domain, it's in WORKGROUP. After following the below steps I am getting the error 1418 (I copied same below).
Steps:
1) Master Key
2) Certificate
3) Repeated above two steps in mirror instance
4) Create Full backup and Log backup after that Restore to destination instance
5) Executed the below script on mirror instance to set up mirroring and it ran successful
-- Mirror Server
USE MASTER
GO
CREATE MASTER KEY ENCRYPTION BY PASSWORD ='Database@1234'
GO
CREATE CERTIFICATE HOST_Mirr_cert
WITH SUBJECT = 'HOST_Mirr certificate'
--START_DATE = '2016-07-22 09:28:14.230'
GO
--select * from sys.database_mirroring_endpoints
DROP ENDPOINT endpoint_mirroring
GO
CREATE ENDPOINT End_Mirroring
STATE = STARTED
AS TCP (LISTENER_PORT = 5023, LISTENER_IP = ALL)
FOR DATABASE_MIRRORING
(
AUTHENTICATION = CERTIFICATE HOST_Mirr_cert,
ENCRYPTION = REQUIRED ALGORITHM RC4,
ROLE = ALL
)
GO
BACKUP CERTIFICATE HOST_Mirr_cert
TO FILE = 'D:\Mirroring\MirrorCertificate\HOST_Mirr_cert.cer'
GO
------------------------------------
-----------------------
USE MASTER
GO
/*
* We are creating a SQL Login here. For Windows logins,
* use the Grant Login instead of Create Login
*/
CREATE LOGIN HOST_Prin_login WITH PASSWORD ='Database@1234'
GO
CREATE USER HOST_Prin_user FOR LOGIN HOST_Prin_login
GO
CREATE CERTIFICATE HOST_PRIN_cert
AUTHORIZATION HOST_Prin_user
FROM FILE ='D:\Mirroring\PrincipalCertificates\HOST_PRIN_cert.cer'
GO
GRANT CONNECT ON ENDPOINT::End_Mirroring TO [HOST_Prin_login]
GO
-----------------------------------
ALTER DATABASE Dbase_mirror3
SET PARTNER = 'TCP://WIN-B6LEQ1TAVAM:5022'
GO