SQL SERVER 登陆错误:18456
SQL Windows身份登录失败,错误码:18456
先用sa进入
EXEC xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SOFTWARE\Microsoft\Microsoft SQL Server\MSSQLServer', N'LoginMode'
-- 启用TCP/IP协议
EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'SOFTWARE\Microsoft\Microsoft SQL Server\MSSQLServer\SuperSocketNetLib\Tcp', N'Enabled', REG_DWORD, 1
//查询登录账户
SELECT name,type_desc,is_disabled
FROM sys.server_principals
WHERE type_desc = 'WINDOWS_LOGIN' AND name = 'your_windows_account';
创建登录账户
CREATE LOGIN [LAPTOP-46N8T2QN\Administrator] FROM WINDOWS
标签:登录,账户,windows,SQL,sa,Microsoft From: https://www.cnblogs.com/shangdishijiao/p/18393678